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