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