summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Pryor <profjim@jimpryor.net>2009-08-11 18:49:05 +0200
committerJames Rayner <james@archlinux.org>2009-09-07 11:50:23 +0200
commit3ae7e093c27350ced6ffaf99a3bca6bc56c559b8 (patch)
tree33739118bd44316ad4b44506bc231835329ad1f5 /src
parentc2b6decd51289abe3d969f305f709fb4243fe6f1 (diff)
downloadnetctl-3ae7e093c27350ced6ffaf99a3bca6bc56c559b8.tar.gz
netctl-3ae7e093c27350ced6ffaf99a3bca6bc56c559b8.tar.xz
respect TMPDIR
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
Diffstat (limited to 'src')
-rw-r--r--src/connections/wireless2
-rw-r--r--src/netcfg-menu10
-rw-r--r--src/wireless6
3 files changed, 9 insertions, 9 deletions
diff --git a/src/connections/wireless b/src/connections/wireless
index a0191b6..d341e99 100644
--- a/src/connections/wireless
+++ b/src/connections/wireless
@@ -204,7 +204,7 @@ wireless_down() {
fi
report_debug wireless_down stop_wpa "$INTERFACE"
stop_wpa "$INTERFACE"
- [[ "$SECURITY" == "wpa" ]] && rm -rf "/tmp/wpa.${PROFILE// /}" # remove tmp wpa config
+ [[ "$SECURITY" == "wpa" ]] && rm -rf "${TMPDIR:-/tmp}/wpa.${PROFILE// /}" # remove tmp wpa config
report_debug wireless_down iwconfig "$INTERFACE" essid off key off
iwconfig "$INTERFACE" essid off key off &> /dev/null
# respects quirk nodown---is that appropriate?
diff --git a/src/netcfg-menu b/src/netcfg-menu
index 21b5651..c5e5324 100644
--- a/src/netcfg-menu
+++ b/src/netcfg-menu
@@ -26,7 +26,7 @@ fi
[ "$NETWORKS_MENU_DEFAULT" ] && DEFAULT="$NETWORKS_MENU_DEFAULT"
# if no default yet, use the first entry
[ "$DEFAULT" = "" ] && DEFAULT="${profiles[0]}"
-ANSWER=$(mktemp /tmp/menu.XXXXXXXX) || exit 1
+ANSWER=$(mktemp --tmpdir menu.XXXXXXXX) || exit 1
# Set timeout
if [ "$1" = "" ]; then
@@ -38,7 +38,7 @@ fi
# Display Dialog
dialog --timeout "$TIMEOUT" --default-item "$DEFAULT" \
--menu "Select the network profile you wish to use" \
- 13 50 6 "${profiles[@]}" 2> $ANSWER
+ 13 50 6 "${profiles[@]}" 2> "$ANSWER"
ret=$?
@@ -50,15 +50,15 @@ case $ret in
if [[ $ret -eq 0 ]]; then echo "$DEFAULT" > "$STATE_DIR/menu"; fi
;;
0) # User selection
- profile_up "$(cat $ANSWER)"
+ profile_up "$(cat "$ANSWER")"
ret=$?
- if [[ $ret -eq 0 ]]; then mv $ANSWER "$STATE_DIR/menu"; fi
+ if [[ $ret -eq 0 ]]; then mv "$ANSWER" "$STATE_DIR/menu"; fi
;;
*) # Shouldnt happen
exit_err "Abnormal ret code from dialog: $ret"
;;
esac
-rm -f $ANSWER # JP: add -f
+rm -f "$ANSWER" # JP: add -f
exit $ret # JP: exit with caught $?
# vim: set ts=4 et sw=4:
diff --git a/src/wireless b/src/wireless
index 81a8408..e778627 100644
--- a/src/wireless
+++ b/src/wireless
@@ -91,7 +91,7 @@ list_networks()
# is hard, obscure and kinda nasty. This is simpler and clearer.
[[ -z "$INTERFACE" ]] && return 1
- essids=$(mktemp /tmp/essid.XXXXXXXX)
+ essids=$(mktemp --tmpdir essid.XXXXXXXX)
wpa_supplicant -B -i$INTERFACE -Dwext -C/var/run/wpa_supplicant -P/var/run/wpa_supplicant.pid
@@ -115,8 +115,8 @@ list_networks()
kill $(cat /var/run/wpa_supplicant.pid)
# File of 0 length, ie. no ssid's.
- if [[ ! -s $essids ]]; then
- rm -f $essids
+ if [[ ! -s "$essids" ]]; then
+ rm -f "$essids"
return 1
fi