mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
! -z -> -n
This commit is contained in:
parent
7da1dc5461
commit
7d7eddf98a
1 changed files with 3 additions and 3 deletions
|
@ -358,13 +358,13 @@ start)
|
||||||
touch /tmp/.ynh-hotspot-started
|
touch /tmp/.ynh-hotspot-started
|
||||||
|
|
||||||
# Check old state of the ipv4 NAT settings
|
# Check old state of the ipv4 NAT settings
|
||||||
if [ ! -z "${old_gateway_interface}" -a "${new_gateway_interface}" != "${old_gateway_interface}" ] && is_nat_set "${old_gateway_interface}"; then
|
if [ -n "${old_gateway_interface}" ] && [ "${new_gateway_interface}" != "${old_gateway_interface}" ] && is_nat_set "${old_gateway_interface}"; then
|
||||||
|
|
||||||
unset_nat "${old_gateway_interface}"
|
unset_nat "${old_gateway_interface}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set ipv4 NAT
|
# Set ipv4 NAT
|
||||||
if [ ! -z "${new_gateway_interface}" ] && ! is_nat_set "${new_gateway_interface}"; then
|
if [ -n "${new_gateway_interface}" ] && ! is_nat_set "${new_gateway_interface}"; then
|
||||||
echo "Set NAT"
|
echo "Set NAT"
|
||||||
set_nat "${new_gateway_interface}"
|
set_nat "${new_gateway_interface}"
|
||||||
fi
|
fi
|
||||||
|
@ -442,7 +442,7 @@ stop)
|
||||||
echo "[hotspot] Stopping..."
|
echo "[hotspot] Stopping..."
|
||||||
rm -f /tmp/.ynh-hotspot-started
|
rm -f /tmp/.ynh-hotspot-started
|
||||||
|
|
||||||
if [ ! -z "${old_gateway_interface}" ] && is_nat_set "${old_gateway_interface}"; then
|
if [ -n "${old_gateway_interface}" ] && is_nat_set "${old_gateway_interface}"; then
|
||||||
echo "Unset NAT"
|
echo "Unset NAT"
|
||||||
unset_nat "${old_gateway_interface}"
|
unset_nat "${old_gateway_interface}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue