-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupgrade.sh
executable file
·54 lines (45 loc) · 1.13 KB
/
upgrade.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
if [ $# -eq 1 -a "$1" = "noreboot" ]; then
REBOOT=
else
REBOOT=y
fi
echo "*************************************************************"
echo "* Upgrading ASTRID *"
echo "* ASTRID MUST BE ABLE TO CONNECT TO THE INTERNET TO UPGRADE *"
echo "*************************************************************"
echo
echo "Proceed? (y/n)"
read line
if [ "$line" != "y" ];then
echo "Upgrade aborted..."
echo "Press <RETURN> to continue"
read line
exit 1
fi
echo "Downloading upgrade files..."
cd /home/pi
git clone https://github.com/ChasinSpin/astrid.git -- /home/pi/astridUpgrade
if [ $? != 0 ];then
echo "Error: Git transfer failed. Internet Connection?"
echo "Press <RETURN> to continue"
read line
exit 1
fi
# Do any upgrade specific stuff here
echo "Upgrading..."
# Install
echo "Installing..."
cd /home/pi
/usr/bin/mv astrid astridOld
/usr/bin/mv astridUpgrade astrid
cd /home/pi/astrid
./install.sh
/usr/bin/rm -rf /home/pi/astridOld
echo "**** Upgrade complete ****"
if [ ! -z "$REBOOT" -a "$REBOOT" = "y" ];then
echo "Press <RETURN> to REBOOT"
read line
/usr/bin/sudo reboot
fi
exit 0