From 5dc34890ebda8bf9e5315edf5a21e4302b86a082 Mon Sep 17 00:00:00 2001 From: Moul Date: Tue, 31 May 2016 21:22:59 +0000 Subject: [PATCH] [fix/Enh] Nginx conf wasn't applied. Add set -eu. - [fix] do not move in /twp directory. Manage Debian package from current directory. - [enh] add 'set -eu' in install and update scripts. Remove it from remove script. --- scripts/install | 10 +++++----- scripts/remove | 2 -- scripts/upgrade | 12 ++++++++++-- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index 118759b..a36bca9 100755 --- a/scripts/install +++ b/scripts/install @@ -1,6 +1,7 @@ #!/bin/bash -#set -e +# Exit on command errors and treat unset variables as an error +set -eu # Retrieve arguments app=duniter @@ -43,17 +44,16 @@ sudo yunohost firewall allow TCP $port > /dev/null 2>&1 ynh_app_setting_set $app port $port # Install Duniter -cd /tmp arch=$(uname -m) if [ $arch == "x86_64" ]; then arch="x64" - wget -nc https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb + wget -nc https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp #elif [ $arch == "armv7l" ]; then -# wget -nc https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb +# wget -nc https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp else ynh_die "$arch is not currently supported." 2 fi -sudo dpkg -i duniter-$version-linux-$arch.deb +sudo dpkg -i /tmp/duniter-$version-linux-$arch.deb #sudo rm -f /tmp/duniter-$version-linux-$arch.deb #source ~/.bashrc diff --git a/scripts/remove b/scripts/remove index bdf0422..4d4e1fd 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,5 @@ #!/bin/bash -#set -e - # Source app helpers source /usr/share/yunohost/helpers diff --git a/scripts/upgrade b/scripts/upgrade index 30f9bde..93b1ca2 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,8 +1,16 @@ #!/bin/bash -#set -e +# Exit on command errors and treat unset variables as an error +set -eu app=duniter +# Stop duniter daemon +sudo $app stop + # Upgrade Duniter package -$app restart +#dpkg -r +#dpkg -i + +# Start duniter daemon +sudo $app start