Don't read from pipe if we have more than 2 arguments
This commit is contained in:
parent
f143ddd584
commit
d3be5fa7a0
@ -94,9 +94,10 @@ if [[ $# -lt 1 ]]; then
|
|||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WIFI_IFACE=$1
|
WIFI_IFACE=$1
|
||||||
|
|
||||||
if tty -s; then
|
if [[ $# -gt 2 ]]; then
|
||||||
if [[ $SHARE_INTERNET -eq 1 ]]; then
|
if [[ $SHARE_INTERNET -eq 1 ]]; then
|
||||||
if [[ $# -ne 3 && $# -ne 4 ]]; then
|
if [[ $# -ne 3 && $# -ne 4 ]]; then
|
||||||
usage
|
usage
|
||||||
@ -121,9 +122,15 @@ else
|
|||||||
fi
|
fi
|
||||||
INTERNET_IFACE=$2
|
INTERNET_IFACE=$2
|
||||||
fi
|
fi
|
||||||
|
if tty -s; then
|
||||||
|
read -p "SSID: " SSID
|
||||||
|
read -p "Passphrase: " -s PASSPHRASE
|
||||||
|
echo
|
||||||
|
else
|
||||||
read SSID
|
read SSID
|
||||||
read PASSPHRASE
|
read PASSPHRASE
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $(id -u) -ne 0 ]]; then
|
if [[ $(id -u) -ne 0 ]]; then
|
||||||
echo "You must run it as root."
|
echo "You must run it as root."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user