-
Notifications
You must be signed in to change notification settings - Fork 10
/
update.sh
executable file
·66 lines (53 loc) · 2.28 KB
/
update.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
55
56
57
58
59
60
61
62
63
#!/bin/bash
#if [ "$(id -u)" != "0" ]; then
# echo "This script must be run like: sudo ./update.sh" 1>&2
# exit 1
#fi
echo "This script is outdated. Please goto https://github.com/ssilverm/piplay-installer for the latest."
exit 1
echo "Starting Update..."
sudo apt-get update
git pull
git clone https://github.com/ssilverm/PiMAME.git
cd PiMAME
git pull
PREVGITFILE_mame=$(git show HEAD~1:.advance/advmame.rc | md5sum | awk '{ print $1 }')
CURRENTFILE_mame=$(cat /home/pi/.advance/advmame.rc | md5sum | awk '{ print $1 }')
if [ "$PREVGITFILE_mame" = "$CURRENTFILE_mame" ]; then
#DO COPY STUFF HERE
echo "Default AdvMAME configuration, updating."
cp .advance/advmame.rc.default /home/pi/.advance/advmame.rc
else
echo "AdvMAME config file has been changed. Not overwriting. Current Version in advmame.rc.default"
cp .advance/advmame.rc.default /home/pi/.advance/advmame.rc.default
fi
PREVGITFILE_menu=$(git show HEAD~1:.advance/advmenu.rc | md5sum | awk '{ print $1 }')
CURRENTFILE_menu=$(cat /home/pi/.advance/advmenu.rc | md5sum | awk '{ print $1 }')
if [ "$PREVGITFILE_menu" = "$CURRENTFILE_menu" ]; then
#DO COPY STUFF HERE
echo "Default AdvMENU configuration, updating."
cp .advance/advmenu.rc.default /home/pi/.advance/advmenu.rc
else
echo "AdvMENU config file has been changed. Not overwriting. Current Version in advmenu.rc.default"
cp .advance/advmenu.rc.default /home/pi/.advance/advmenu.rc.default
fi
PREVGITFILE_neo=$(git show HEAD~1:.gngeo/gngeorc | md5sum | awk '{ print $1 }')
CURRENTFILE_neo=$(cat /home/pi/.gngeo/gngeorc | md5sum | awk '{ print $1 }')
if [ "$PREVGITFILE_neo" = "$CURRENTFILE_neo" ]; then
#DO COPY STUFF HERE
echo "Default GNGeo configuration, updating."
cp .gngeo/gngeorc.default /home/pi/.gngeo/gngeorc
else
echo "GNGeo config file has been changed. Not overwriting. Current Version in gngeorc.default"
cp .gngeo/gngeorc.default /home/pi/.gngeo/gngeorc.default
fi
cd ..
sudo cp config_files/vsftpd.conf /etc/vsftpd.conf
sudo cp config_files/php.ini /etc/php5/cgi/php.ini
sudo cp config_files/lighttpd.conf /etc/lighttpd/lighttpd.conf
sudo cp config_files/10-cgi.conf /etc/lighttpd/conf-enabled/10-cgi.conf
sudo cp config_files/inittab /etc/
sudo cp -r PiMAME/www/ /var/
sudo /etc/init.d/lighttpd force-reload
#### Updated Files Go Here
source update_include.sh