Fix upgrade/restore script
This commit is contained in:
@@ -49,12 +49,12 @@ if ! $upgrade; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check domain/path availability
|
fi
|
||||||
sudo yunohost app checkurl ${domain}${url_path} -a hotspot
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Check domain/path availability
|
||||||
|
sudo yunohost app checkurl ${domain}${url_path} -a hotspot
|
||||||
|
if [ ! $? -eq 0 ]; then
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
@@ -134,10 +134,6 @@ if ! $upgrade; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Save git commit
|
|
||||||
gitcommit=$(git rev-parse HEAD)
|
|
||||||
sudo yunohost app setting hotspot gitcommit -v "${gitcommit}"
|
|
||||||
|
|
||||||
# Install custom scripts
|
# Install custom scripts
|
||||||
sudo install -o root -g root -m 0755 ../conf/iw_multissid /usr/local/bin/
|
sudo install -o root -g root -m 0755 ../conf/iw_multissid /usr/local/bin/
|
||||||
sudo install -o root -g root -m 0755 ../conf/iw_devices /usr/local/bin/
|
sudo install -o root -g root -m 0755 ../conf/iw_devices /usr/local/bin/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
gitcommit=$(sudo yunohost app setting hotspot gitcommit)
|
gitcommit=$(sudo grep revision /etc/yunohost/apps/hotspot/status.json | sed 's/.*"revision": "\([^"]\+\)".*/\1/')
|
||||||
tmpdir=$(mktemp -dp /tmp/ hotspot-restore-XXXXX)
|
tmpdir=$(mktemp -dp /tmp/ hotspot-restore-XXXXX)
|
||||||
|
|
||||||
git clone https://github.com/labriqueinternet/hotspot_ynh.git "${tmpdir}/"
|
git clone https://github.com/labriqueinternet/hotspot_ynh.git "${tmpdir}/"
|
||||||
|
|||||||
@@ -27,13 +27,9 @@ export HOTSPOT_UPGRADE=1
|
|||||||
sudo bash /etc/yunohost/apps/hotspot/scripts/remove &> /dev/null
|
sudo bash /etc/yunohost/apps/hotspot/scripts/remove &> /dev/null
|
||||||
bash ./install "${domain}" "${path}" "${wifi_ssid}" "${wifi_passphrase}" "${firmware_nonfree}"
|
bash ./install "${domain}" "${path}" "${wifi_ssid}" "${wifi_passphrase}" "${firmware_nonfree}"
|
||||||
|
|
||||||
gitcommit=$(ynh_setting hotspot gitcommit)
|
|
||||||
|
|
||||||
sudo cp -a "${tmpdir}/settings.yml" /etc/yunohost/apps/hotspot/
|
sudo cp -a "${tmpdir}/settings.yml" /etc/yunohost/apps/hotspot/
|
||||||
sudo rm -r "${tmpdir}/"
|
sudo rm -r "${tmpdir}/"
|
||||||
|
|
||||||
sudo yunohost app setting hotspot gitcommit -v "${gitcommit}"
|
|
||||||
|
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
if [ -z "$(ynh_setting hotspot ip6_firewall)" ]; then
|
if [ -z "$(ynh_setting hotspot ip6_firewall)" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user