diff options
author | Minteck <freeziv.ytb@gmail.com> | 2021-03-07 18:29:17 +0100 |
---|---|---|
committer | Minteck <freeziv.ytb@gmail.com> | 2021-03-07 18:29:17 +0100 |
commit | 0f79e708bf07721b73ea41e5d341be08e8ea4dce (patch) | |
tree | f3c63cd6a9f4ef0b26f95eec6a031600232e80c8 /shared/updates.sh | |
download | electrode-0f79e708bf07721b73ea41e5d341be08e8ea4dce.tar.gz electrode-0f79e708bf07721b73ea41e5d341be08e8ea4dce.tar.bz2 electrode-0f79e708bf07721b73ea41e5d341be08e8ea4dce.zip |
Initial commit
Diffstat (limited to 'shared/updates.sh')
-rw-r--r-- | shared/updates.sh | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/shared/updates.sh b/shared/updates.sh new file mode 100644 index 0000000..4291665 --- /dev/null +++ b/shared/updates.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +echo "updater: Downloading update..." + +wget https://github.com/Minteck-Projects/Neutron-Core/archive/trunk.zip &>/dev/null +code=$? +if [[ $code -eq 0 ]]; then + echo "updater: Success" +else + echo "updater: Failed with code $code" + echo "updater: Cleaning up..." + rm -dr trunk.zip* + exit $code +fi + +echo "updater: Extracting..." + +unzip trunk.zip +code=$? +if [[ $code -eq 0 || $code -eq 2 ]]; then + echo "updater: Success" +else + echo "updater: Failed with code $code" + echo "updater: Cleaning up..." + rm -dr trunk.zip* + exit $code +fi + +echo "updater: Please wait while Updater prepare Neutron-Core to be installed..." + +rm -dr ./public/api +rm -dr ./public/cms-special +rm -dr ./public/widgets +rm -dr ./public/resources/css +rm -dr ./public/resources/image +rm -dr ./public/resources/fonts +rm -dr ./public/resources/i18n +rm -dr ./public/resources/js +rm -dr ./public/resources/lib +rm -dr ./public/resources/private +rm -dr ./public/index.php + +echo "updater: Installing..." + +cp -r Neutron-Core-trunk/* ./public/ +code=$? +if [[ $code -eq 0 ]]; then + echo "updater: Success" +else + echo "updater: Failed with code $code" + echo "updater: Cleaning up..." + rm -dr trunk.zip* + exit $code +fi + +rm -dr Neutron-Core-trunk/ +code=$? +if [[ $code -eq 0 ]]; then + echo "updater: Success" +else + echo "updater: Failed with code $code" + echo "updater: Cleaning up..." + rm -dr trunk.zip* + exit $code +fi + +echo "updater: Updating version..." +date +%Y%m%d-#-electrode > ./public/api/version +code=$? +if [[ $code -eq 0 ]]; then + echo "updater: Success" +else + echo "updater: Failed with code $code" + echo "updater: Cleaning up..." + rm -dr trunk.zip* + exit $code +fi + +echo "updater: Cleaning up..." +rm -dr trunk.zip* |