From 4e39c8090b1cad044e7292b8a41052993076d5fa Mon Sep 17 00:00:00 2001 From: Pecusx Date: Mon, 31 Oct 2016 18:58:43 +0100 Subject: [PATCH] Better (???) update procedure. --- html/scripts/cancel_update.sh | 5 +++++ html/scripts/github_download.sh | 6 ++++++ html/scripts/github_update.sh | 11 ++++------- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 html/scripts/cancel_update.sh create mode 100644 html/scripts/github_download.sh diff --git a/html/scripts/cancel_update.sh b/html/scripts/cancel_update.sh new file mode 100644 index 0000000..fa2252d --- /dev/null +++ b/html/scripts/cancel_update.sh @@ -0,0 +1,5 @@ +# Remove temp dir: /usr/share/piradio-mini-master +rm -r /usr/share/piradio-mini-master + +# Remove github file +rm /home/pi/piradionew.zip \ No newline at end of file diff --git a/html/scripts/github_download.sh b/html/scripts/github_download.sh new file mode 100644 index 0000000..9778ac5 --- /dev/null +++ b/html/scripts/github_download.sh @@ -0,0 +1,6 @@ +# Download actual master from github +wget --output-document=/home/pi/piradionew.zip https://github.com/pkali/piradio-mini/archive/master.zip + +# Unzip to temp dir: /usr/share/piradio-mini-master +rm -r /usr/share/piradio-mini-master +unzip /home/pi/piradionew.zip -d /usr/share/ diff --git a/html/scripts/github_update.sh b/html/scripts/github_update.sh index a5ae196..ba5356d 100644 --- a/html/scripts/github_update.sh +++ b/html/scripts/github_update.sh @@ -1,10 +1,4 @@ -# Download actual master from github -wget --output-document=/home/pi/piradionew.zip https://github.com/pkali/piradio-mini/archive/master.zip - -# Unzip to temp dir: /usr/share/piradio-mini-master -rm -r /usr/share/piradio-mini-master -unzip /home/pi/piradionew.zip -d /usr/share/ - +# Actual master from github downloaded and unpacked by github_download.sh (update.php) # Backup actual files tar -cvzf /home/pi/backup.tar /usr/share/radio/ @@ -15,5 +9,8 @@ chmod -R 0777 /usr/share/radio/* # Remove temp dir: /usr/share/piradio-mini-master rm -r /usr/share/piradio-mini-master +# Remove github file +rm /home/pi/piradionew.zip + # Reboot after update reboot