mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
Merge branch 'master' into update-scripts-to-the-new-standard
This commit is contained in:
commit
b858a19517
2 changed files with 8 additions and 4 deletions
|
@ -320,7 +320,7 @@ case "$1" in
|
||||||
start)
|
start)
|
||||||
if is_running; then
|
if is_running; then
|
||||||
echo "Already started"
|
echo "Already started"
|
||||||
elif [ "${ynh_service_enabled}" -eq 0 ]; then
|
elif [ "${ynh_service_enabled}" != "enabled" ]; then
|
||||||
echo "Disabled service"
|
echo "Disabled service"
|
||||||
else
|
else
|
||||||
echo "[hotspot] Starting..."
|
echo "[hotspot] Starting..."
|
||||||
|
@ -469,7 +469,7 @@ case "$1" in
|
||||||
status)
|
status)
|
||||||
exitcode=0
|
exitcode=0
|
||||||
|
|
||||||
if [ "${ynh_service_enabled}" -eq 0 ]; then
|
if [ "${ynh_service_enabled}" != "enabled" ]; then
|
||||||
echo "[ERR] Hotspot Service disabled"
|
echo "[ERR] Hotspot Service disabled"
|
||||||
exitcode=1
|
exitcode=1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -265,6 +265,10 @@ find ${final_path}/ -type d -exec chmod +x {} \;
|
||||||
|
|
||||||
## hostapd
|
## hostapd
|
||||||
ynh_replace_string "^DAEMON_CONF=$" "&/etc/hostapd/hostapd.conf" /etc/init.d/hostapd
|
ynh_replace_string "^DAEMON_CONF=$" "&/etc/hostapd/hostapd.conf" /etc/init.d/hostapd
|
||||||
|
# We also need to put this in /etc/default/hostapd because on some setup
|
||||||
|
# like RPi, the version of hostapd is different and /etc/init.d/hostapd
|
||||||
|
# isnt used ... instead the service is "pure systemd" ...
|
||||||
|
echo "DAEMON_CONF=/etc/hostapd/hostapd.conf" > /etc/default/hostapd
|
||||||
|
|
||||||
# Fix sources
|
# Fix sources
|
||||||
ynh_replace_string "__PATH__" "${path_url}" "$final_path/config.php"
|
ynh_replace_string "__PATH__" "${path_url}" "$final_path/config.php"
|
||||||
|
@ -290,6 +294,7 @@ ynh_add_systemd_config $service_name
|
||||||
# and the ynh-hotspot service handles them.
|
# and the ynh-hotspot service handles them.
|
||||||
systemctl disable hostapd
|
systemctl disable hostapd
|
||||||
systemctl stop hostapd
|
systemctl stop hostapd
|
||||||
|
systemctl unmask hostapd # On some system e.g. RPi, for some reason hostapd is masked after install ...
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND PHP-FPM
|
# RELOAD NGINX AND PHP-FPM
|
||||||
|
@ -301,8 +306,7 @@ systemctl reload nginx
|
||||||
|
|
||||||
# Remove IPv6 address set if there is a VPN installed
|
# Remove IPv6 address set if there is a VPN installed
|
||||||
if [[ $ip6_addr != none ]]; then
|
if [[ $ip6_addr != none ]]; then
|
||||||
ip -6 address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"
|
if ip -6 address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"; then
|
||||||
if [[ "$?" -eq 0 ]]; then
|
|
||||||
ip address delete "${ip6_addr}/128" dev tun0 &> /dev/null
|
ip address delete "${ip6_addr}/128" dev tun0 &> /dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue