tazpanel diff network.cgi @ rev 638

boot.iso: allow /dev/cdrom
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 05 15:14:01 2022 +0000 (2022-01-05)
parents bf8941ab3cc3
children
line diff
     1.1 --- a/network.cgi	Tue Feb 26 08:30:05 2019 +0100
     1.2 +++ b/network.cgi	Wed Jan 05 15:14:01 2022 +0000
     1.3 @@ -29,7 +29,7 @@
     1.4  
     1.5  	# Sleep until connection established (max 5 seconds)
     1.6  	for i in $(seq 5); do
     1.7 -		[ -n "$(iwconfig 2>/dev/null | fgrep Link)" ] && break
     1.8 +		iwconfig 2>/dev/null | fgrep -q Link && break
     1.9  		sleep 1
    1.10  	done
    1.11  }
    1.12 @@ -108,7 +108,7 @@
    1.13  
    1.14  wait_up() {
    1.15  	for i in $(seq 5); do
    1.16 -		[ -z "$(cat /sys/class/net/*/operstate | fgrep up)"] && sleep 1
    1.17 +		cat /sys/class/net/*/operstate | fgrep -q up || sleep 1
    1.18  	done
    1.19  }
    1.20  
    1.21 @@ -150,7 +150,7 @@
    1.22  		;;
    1.23  	*\ hostname\ *)
    1.24  		hostname="$(GET hostname)"
    1.25 -		echo $(_ 'Changed hostname: %s' "$hostname") | log
    1.26 +		_ 'Changed hostname: %s' "$hostname" | log
    1.27  		echo "$hostname" > /etc/hostname;;
    1.28  	*\ rmarp\ *)
    1.29  		arp -d $(urldecode "$(GET entry)") ;;
    1.30 @@ -393,10 +393,10 @@
    1.31  
    1.32  				# Authentication type
    1.33  				AUTH="$(echo "$SCAN" | sed -n 's|.*Authentication Suites[^:]*: *\(.*\)|\1|p')"
    1.34 -				if [ -n "$(echo -n $AUTH | fgrep PSK)" ]; then
    1.35 +				if echo -n $AUTH | fgrep -q PSK; then
    1.36  					# WPA-Personal. Authentication using password (PSK = pre-shared key)
    1.37  					WIFI_KEY_TYPE='WPA'
    1.38 -				elif [ -n "$(echo -n $AUTH | fgrep 802.1x)" ]; then
    1.39 +				elif echo -n $AUTH | fgrep -q 802.1x; then
    1.40  					# WPA-Enterprise. Authentication using username, password, certificates...
    1.41  					WIFI_KEY_TYPE='EAP'
    1.42  				else
    1.43 @@ -725,7 +725,7 @@
    1.44  			[ $(($(cat /sys/class/net/$i/flags) & 0x1080)) -eq 4096 ] &&
    1.45  			echo $i
    1.46  		done)"
    1.47 -		if [ "$REMOTE_USER" = "root" -a -n "$devs" ]; then
    1.48 +		if [ "$REMOTE_USER" = "root" ] && [ -n "$devs" ]; then
    1.49  			cat <<EOT
    1.50  <section>
    1.51  	<header id="vlan">$(_ 'VLAN')</header>
    1.52 @@ -837,7 +837,7 @@
    1.53  </section>
    1.54  
    1.55  EOT
    1.56 -		[ "$REMOTE_USER" = "root" -a "$(which iptables-save)" ] && cat <<EOT
    1.57 +		[ "$REMOTE_USER" = "root" ] && [ "$(which iptables-save)" ] && cat <<EOT
    1.58  <section>
    1.59  	<header id="iptables">$(_ 'Firewall')
    1.60  		$(edit_button /etc/knockd.conf "$(_ 'Port knocker')")