projects
/
scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added the ua (unarchive) shortcut + an option in selector-history.
[scripts.git]
/
hotspot.sh
diff --git
a/hotspot.sh
b/hotspot.sh
index
e3cac28
..
a8a27ae
100755
(executable)
--- a/
hotspot.sh
+++ b/
hotspot.sh
@@
-17,7
+17,10
@@
# Contact <francois@fleuret.org> for comments & bug reports #
#########################################################################
# Contact <francois@fleuret.org> for comments & bug reports #
#########################################################################
-INTERFACE=wlan0
+INTERFACE=${WIFI_INTERFACE}
+
+[[ ${INTERFACE} ]] || INTERFACE=wlan0
+
MTU=512
SCAN_OUTPUT=$(mktemp /tmp/scanresult.XXXXXX)
MTU=512
SCAN_OUTPUT=$(mktemp /tmp/scanresult.XXXXXX)
@@
-81,8
+84,8
@@
function scan () {
-e "s/Quality=\([0-9]*\).*$/QUALITY,\1/" \
-e "s/Encryption key:/ENCRYPTION,/" | \
awk 'BEGIN { FS="," }
-e "s/Quality=\([0-9]*\).*$/QUALITY,\1/" \
-e "s/Encryption key:/ENCRYPTION,/" | \
awk 'BEGIN { FS="," }
- {
- if($1 == "ESSID") { essid=$2 }
+
{
+
if($1 == "ESSID") { essid=$2 }
else if($1 == "AP") { ap=$2 }
else if($1 == "QUALITY") { quality=$2; }
else if($1 == "ENCRYPTION") {
else if($1 == "AP") { ap=$2 }
else if($1 == "QUALITY") { quality=$2; }
else if($1 == "ENCRYPTION") {
@@
-258,6
+261,8
@@
if [[ $1 == "-k" ]]; then
exit 1
fi
exit 1
fi
+trap cleanup-before-quit EXIT
+
stty_state=$(stty -g)
trap sigint-handler SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM
stty_state=$(stty -g)
trap sigint-handler SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM
@@
-295,58
+300,56
@@
while [[ ${cont} == 1 ]]; do
;;
"
\ e
")
;;
"
\ e
")
- process-key "down"
- ;;
+
process-key "down"
+
;;
"
\10
")
"
\10
")
- process-key "up"
- ;;
+
process-key "up"
+
;;
"
\e
") #$'\033'")
"
\e
") #$'\033'")
- current_keymap=escape
- ;;
+
current_keymap=escape
+
;;
*)
*)
- ;;
-
esac
-
;;
+
;;
+ esac
+ ;;
-
escape) ##################################################
-
case ${CHAR} in
-
"$'\033'")
+ escape) ##################################################
+ case ${CHAR} in
+ "$'\033'")
process-key "esc-esc"
;;
process-key "esc-esc"
;;
-
"[")
+ "[")
current_keymap=cursor
;;
current_keymap=cursor
;;
-
*)
+ *)
current_keymap=default
;;
current_keymap=default
;;
-
esac
-
;;
+ esac
+ ;;
-
cursor) ##################################################
+ cursor) ##################################################
-
current_keymap=default
+ current_keymap=default
-
case ${CHAR} in
-
A)
+ case ${CHAR} in
+ A)
process-key "up"
;;
process-key "up"
;;
-
B)
+ B)
process-key "down"
;;
process-key "down"
;;
- *)
- ;;
- esac
- ;;
-
*)
*)
- echo "Unknown keymap. This is an internal and weird bug."
- cont=0
- ;;
- esac
+ ;;
+ esac
+ ;;
- done
+ *)
+ echo "Unknown keymap. This is an internal and weird bug."
+ cont=0
+ ;;
+ esac
- cleanup-before-quit
+done