1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00

Apply 'shfmt -bn -i 4 -w' on ynh-hotspot

This commit is contained in:
Alexandre Aubin 2021-11-16 00:20:13 +01:00
parent 3100538cbc
commit 7da1dc5461

View file

@ -314,8 +314,7 @@ if [ "$1" != restart ]; then
ip6_dns[${i}]=""
ip4_dns[${i}]=""
for ip in $(echo "${dns[${i}]}" | tr ',' ' '); do
if [[ "$ip" == *":"* ]]
then
if [[ "$ip" == *":"* ]]; then
ip6_dns[${i}]+="[$ip],"
else
ip4_dns[${i}]+="$ip,"
@ -359,8 +358,7 @@ case "$1" in
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 [ ! -z "${old_gateway_interface}" -a "${new_gateway_interface}" != "${old_gateway_interface}" ] && is_nat_set "${old_gateway_interface}"; then
unset_nat "${old_gateway_interface}"
fi
@ -383,18 +381,17 @@ case "$1" in
configure_hostapd
echo "Starting hostapd..."
if ! systemctl start hostapd
if ! systemctl start hostapd; then
journalctl -u hostapd -n 100 --no-hostname --no-pager
exit 1
fi
sleep 1
i=0;
i=0
while ! ip link show dev hotspot1 &>/dev/null; do
sleep 1
if [ ${i} -gt 20 ]
then
if [ ${i} -gt 20 ]; then
echo "Failed to see hotspot interface showing up in 'ip a'"
stop_hostapd
exit 1