fixed comments and got working
[feisty_meow.git] / customizing / fred / scripts / update_soapbox.sh
1 #!/bin/bash
2
3 # updates my little 1 TB "soapbox" style usb drive with items that it should contain.
4
5 function get_source()
6 {
7   folder="$1"; shift
8   echo getting latest codes in $folder...
9   pushd "$folder"
10   if [ $? -ne 0 ]; then
11     echo Changing to the folder $folder failed.
12     exit 1
13   fi
14   bash "$FEISTY_MEOW_SCRIPTS/rev_control/rev_checkin.sh"
15   if [ $? -ne 0 ]; then
16     echo Checking out the latest codes has failed somehow for $folder.
17     exit 1
18   fi
19   popd
20 }
21
22 sep
23
24 ls /media/fred/soapboxdrive
25 if [ $? -ne 0 ]; then
26   echo The soapbox drive is not mounted currently, so cannot be updated.
27   exit 1
28 fi
29
30 sep
31
32 echo synching walrus...
33 rsync -av /z/walrus/* /media/fred/soapboxdrive/walrus/
34 if [ $? -ne 0 ]; then
35   echo The walrus sync failed.
36   exit 1
37 fi
38
39 sep
40
41 echo synching musix...
42 rsync -av /z/musix/* /media/fred/soapboxdrive/musix/
43 if [ $? -ne 0 ]; then
44   echo The musix sync failed.
45   exit 1
46 fi
47
48 sep
49
50 echo getting latest fred codes...
51 pushd /media/fred/soapboxdrive
52 get_source extra_brain
53
54 sep
55
56 echo getting latest gffs codes...
57 get_source gffs
58 popd
59
60 sep
61
62 echo Updated all portions of the soapbox drive successfully.
63