Improve upgrade script
This commit is contained in:
@@ -33,14 +33,14 @@ if ! $upgrade; then
|
|||||||
ynh_version=$(sudo dpkg -l yunohost | grep ii | awk '{ print $3 }' | sed 's/\.//g')
|
ynh_version=$(sudo dpkg -l yunohost | grep ii | awk '{ print $3 }' | sed 's/\.//g')
|
||||||
|
|
||||||
if [ "${ynh_version}" -lt 220 ]; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo systemctl is-active dnsmasq &> /dev/null
|
sudo systemctl is-active dnsmasq &> /dev/null
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -209,12 +209,12 @@ if [ "${ip6_addr}" != none ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
sudo systemctl enable ynh-hotspot
|
sudo systemctl enable ynh-hotspot
|
||||||
|
sudo yunohost service add ynh-hotspot
|
||||||
|
|
||||||
if ! $upgrade; then
|
if ! $upgrade; then
|
||||||
sudo systemctl start ynh-hotspot
|
sudo systemctl start ynh-hotspot
|
||||||
|
|
||||||
sudo yunohost service add ynh-hotspot
|
|
||||||
sudo yunohost app ssowatconf
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sudo yunohost app ssowatconf
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ domain=$(sudo yunohost app setting hotspot domain)
|
|||||||
# The End
|
# The End
|
||||||
sudo systemctl stop ynh-hotspot
|
sudo systemctl stop ynh-hotspot
|
||||||
sudo systemctl disable 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 /etc/systemd/system/ynh-hotspot.service /usr/local/bin/ynh-hotspot
|
||||||
sudo rm -f /tmp/.ynh-hotspot-*
|
sudo rm -f /tmp/.ynh-hotspot-*
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user