improved make_tar.sh
[hdw-linux/hdw-linux.git] / misc / internal / make_tar.sh
1 #!/bin/bash
2 #
3 # author: hackbard@hackdaworld.dyndns.org
4 #
5 # hdw - linux make tar script
6 # just for personal use to make tarballs from the cvs snaps!
7 #
8
9 # make a tarball from the hdw sources
10 if [ -z "$1" ] ; then 
11         version="cvs"
12 else
13         version="$1"
14 fi
15
16 rm -f hdw-linux-${version}.tar.bz2
17 rm -rf hdw-linux
18
19 cvs -d:pserver:anonymous@cvs.hackdaworld.dyndns.org:/hdw-linux co hdw-linux &&
20 mv hdw-linux hdw-linux-${version} ; cd hdw-linux-${version}
21 rm -rf CVS
22 rm -rf */CVS
23 rm -rf */*/CVS
24 rm -rf */*/*/CVS
25 rm -rf */*/*/*/CVS
26 rm -rf */*/*/*/*/CVS
27
28 cd ..
29 tar cvf hdw-linux-${version}.tar hdw-linux-${version}
30 bzip2 hdw-linux-${version}.tar
31 myip=`ifconfig eth0 | grep inet\ addr | awk '{ print $2 }' | \
32       awk -F: '{ print $2 }'`
33 if [ "$myip" = "192.168.10.24" ] ; then
34         scp hdw-linux-${version}.tar.bz2 \
35         www.hackdaworld.dyndns.org:/chroot/www/htdocs/download/hdw-linux/hdw-linux-$version/snapshot/
36 else
37         scp -P 1822 hdw-linux-${version}.tar.bz2 \
38         hackdaworld.dyndns.org:/chroot/www/htdocs/download/hdw-linux/hdw-linux-$version/snapshot/
39 fi
40 scp hdw-linux-${version}.tar.bz2 \
41 zirkelfr@everest.physik.uni-augsburg.de:~/public_html/download/hdw-linux/hdw-linux-${version}.tar.bz2
42 rm -rf hdw-linux-${version}
43
44 echo "done"