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