diff --git a/scripts/install b/scripts/install index 2fa10d5..e0fde07 100755 --- a/scripts/install +++ b/scripts/install @@ -35,11 +35,14 @@ else ynh_die "Node $sync_node:$sync_port is not available" 2 fi -# Get CPU architecture +# Get CPU architecture and check it arch=$(uname -m) if [ $arch == "x86_64" ]; then arch="x64" fi +if [ $arch != "x64" ]; then #&& $arch != "armv7l" ]; then + ynh_die "$arch is not currently supported." 2 +fi # Open port on firewall sudo yunohost firewall allow TCP $port > /dev/null 2>&1 @@ -48,12 +51,8 @@ sudo yunohost firewall allow TCP $port > /dev/null 2>&1 ynh_app_setting_set $app port $port ynh_app_setting_set $app arch $arch -# Install Duniter -if [ $arch == "x64" ]; then #|| $arch == "armv7l" ] - wget -nc --quiet 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 +# Retrieve debian package and install it +wget -nc --quiet https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp sudo dpkg -i /tmp/duniter-$version-linux-$arch.deb #sudo rm -f /tmp/duniter-$version-linux-$arch.deb diff --git a/scripts/upgrade b/scripts/upgrade index aa9ad8b..a8fb251 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,6 +15,11 @@ port=$(ynh_app_setting_get "$app" port) arch=$(ynh_app_setting_get "$app" arch) version=$(cat ../conf/upstream_version) +# Check CPU arch +if [ $arch != "x64" ]; then #&& $arch != "armv7l" ], then + ynh_die "$arch is not currently supported." 2 +fi + # Stop duniter daemon sudo $app stop @@ -22,11 +27,7 @@ sudo $app stop sudo dpkg -r duniter # Retrive Duniter package and install it -if [ $arch == "x64" ]; then #|| $arch == "armv7l" ] - wget -nc --quiet 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 +wget -nc --quiet https://github.com/duniter/duniter/releases/download/$version/duniter-$version-linux-$arch.deb -P /tmp sudo dpkg -i /tmp/duniter-$version-linux-$arch.deb #sudo rm -f /tmp/duniter-$version-linux-$arch.deb