From 33cce740f01824eac3cd9919592051cd0963fd18 Mon Sep 17 00:00:00 2001 From: Julien VAUBOURG Date: Fri, 24 Jul 2015 19:44:43 +0200 Subject: [PATCH] Improve upgrade script --- scripts/install | 10 +++++----- scripts/remove | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index f752b30..7700e71 100644 --- a/scripts/install +++ b/scripts/install @@ -33,14 +33,14 @@ if ! $upgrade; then ynh_version=$(sudo dpkg -l yunohost | grep ii | awk '{ print $3 }' | sed 's/\.//g') if [ "${ynh_version}" -lt 220 ]; then - echo "ERROR: You need a YunoHost version equals or greater than 2.2.0" + echo "ERROR: You need a YunoHost version equals or greater than 2.2.0" >&2 exit 1 fi sudo systemctl is-active dnsmasq &> /dev/null if [ $? -ne 0 ]; then - echo "ERROR: You need to enable dnsmasq instead of bind9 (apt-get remove bind9 && systemctl start dnsmasq)" + echo "ERROR: You need to enable dnsmasq instead of bind9 (apt-get remove bind9 && systemctl start dnsmasq)" >&2 exit 1 fi @@ -209,12 +209,12 @@ if [ "${ip6_addr}" != none ]; then fi sudo systemctl enable ynh-hotspot +sudo yunohost service add ynh-hotspot if ! $upgrade; then sudo systemctl start ynh-hotspot - - sudo yunohost service add ynh-hotspot - sudo yunohost app ssowatconf fi +sudo yunohost app ssowatconf + exit 0 diff --git a/scripts/remove b/scripts/remove index ee2e967..bd5ffd8 100644 --- a/scripts/remove +++ b/scripts/remove @@ -23,6 +23,7 @@ domain=$(sudo yunohost app setting hotspot domain) # The End sudo systemctl stop ynh-hotspot sudo systemctl disable ynh-hotspot +sudo yunohost service remove ynh-hotspot sudo rm -f /etc/systemd/system/ynh-hotspot.service /usr/local/bin/ynh-hotspot sudo rm -f /tmp/.ynh-hotspot-*