From 7d7eddf98a26e3bd87fa20fa72778906bd414242 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 16 Nov 2021 00:22:23 +0100 Subject: [PATCH] ! -z -> -n --- conf/ynh-hotspot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/ynh-hotspot b/conf/ynh-hotspot index 18e498d..fa09592 100644 --- a/conf/ynh-hotspot +++ b/conf/ynh-hotspot @@ -358,13 +358,13 @@ start) touch /tmp/.ynh-hotspot-started # 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}" fi # 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" set_nat "${new_gateway_interface}" fi @@ -442,7 +442,7 @@ stop) echo "[hotspot] Stopping..." 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" unset_nat "${old_gateway_interface}" fi