a20ea5fa85ed4da653418d93dcbac755a940e677
[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 liney()
6 {
7   echo
8   echo ==============
9   echo
10 }
11
12 function get_source()
13 {
14   folder="$1"; shift
15   echo getting latest codes in $folder...
16   pushd "$folder"
17   if [ $? -ne 0 ]; then
18     echo Changing to the folder $folder failed.
19     exit 1
20   fi
21   bash "$FEISTY_MEOW_SCRIPTS/rev_control/rev_checkin.sh"
22   if [ $? -ne 0 ]; then
23     echo Checking out the latest codes has failed somehow for $folder.
24     exit 1
25   fi
26   popd
27 }
28
29 liney
30
31 ls /media/fred/soapboxdrive
32 if [ $? -ne 0 ]; then
33   echo The soapbox drive is not mounted currently, so cannot be updated.
34   exit 1
35 fi
36
37 liney
38
39 echo synching walrus...
40 rsync -av /z/walrus/* /media/fred/soapboxdrive/walrus/
41 if [ $? -ne 0 ]; then
42   echo The walrus sync failed.
43   exit 1
44 fi
45
46 liney
47
48 echo synching musix...
49 rsync -av /z/musix/* /media/fred/soapboxdrive/musix/
50 if [ $? -ne 0 ]; then
51   echo The musix sync failed.
52   exit 1
53 fi
54
55 liney
56
57 echo getting latest fred codes...
58 pushd /media/fred/soapboxdrive
59 get_source extra_brain
60
61 liney
62
63 echo getting latest gffs codes...
64 get_source gffs
65 popd
66
67 liney
68
69 echo Updated all portions of the soapbox drive successfully.
70