diff options
author | Rémy Oudompheng <remy@archlinux.org> | 2011-06-11 22:33:39 +0200 |
---|---|---|
committer | Rémy Oudompheng <remy@archlinux.org> | 2011-06-11 22:33:58 +0200 |
commit | ad711a91917752a887cf99f61e8c23986358671f (patch) | |
tree | c9b03b4b9f2c516970fd4e8dcc60afdf554e994e /src | |
parent | b000b55ddc7fad62cd5a0cc2877648e54ee40268 (diff) | |
download | netctl-ad711a91917752a887cf99f61e8c23986358671f.tar.gz netctl-ad711a91917752a887cf99f61e8c23986358671f.tar.xz |
Move wpa_supplicant PID file to /run
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/8021x | 10 | ||||
-rw-r--r-- | src/wireless | 4 |
2 files changed, 7 insertions, 7 deletions
@@ -30,10 +30,10 @@ start_wpa() shift 3 local WPA_OPTS="$*" - wpa_supplicant -B -P "/var/run/wpa_supplicant_${INTERFACE}.pid" -i "$INTERFACE" -D "$WPA_DRIVER" -c "$WPA_CONF" $WPA_OPTS + wpa_supplicant -B -P "/run/wpa_supplicant_${INTERFACE}.pid" -i "$INTERFACE" -D "$WPA_DRIVER" -c "$WPA_CONF" $WPA_OPTS sleep 1 - if [[ ! -f "/var/run/wpa_supplicant_${INTERFACE}.pid" ]]; then + if [[ ! -f "/run/wpa_supplicant_${INTERFACE}.pid" ]]; then return 1 fi } @@ -43,8 +43,8 @@ stop_wpa() wpa_cli -i "$1" terminate &> /dev/null sleep 1 # JP: need this else the file tends to disappear after [[ -f ... ]] but before cat... # see <http://bbs.archlinux.org/viewtopic.php?pid=515667#p515667> - if [[ -f "/var/run/wpa_supplicant_$1.pid" ]]; then - kill "$(cat "/var/run/wpa_supplicant_$1.pid")" &>/dev/null & + if [[ -f "/run/wpa_supplicant_$1.pid" ]]; then + kill "$(cat "/run/wpa_supplicant_$1.pid")" &>/dev/null & fi } @@ -56,7 +56,7 @@ make_wpa_config_file() { # make empty tmp dir with correct permissions, rename it rm -rf "$WPA_CONF" mv -f "$(mktemp -d)" "$WPA_CONF" || return 1 - echo "ctrl_interface=/var/run/wpa_supplicant" >> "$WPA_CONF/wpa.conf" # we know $WPA_CONF now has no spaces, but it may have other nasty chars, so still needs to be quoted + echo "ctrl_interface=/run/wpa_supplicant" >> "$WPA_CONF/wpa.conf" # we know $WPA_CONF now has no spaces, but it may have other nasty chars, so still needs to be quoted echo "ctrl_interface_group=${WPA_GROUP:-wheel}" >> "$WPA_CONF/wpa.conf" [[ $WPA_COUNTRY ]] && echo "country=$WPA_COUNTRY" >> "$WPA_CONF/wpa.conf" [[ -n "$ADHOC" ]] && echo "ap_scan=2" >> "$WPA_CONF/wpa.conf" diff --git a/src/wireless b/src/wireless index 22b84a9..8a75d68 100644 --- a/src/wireless +++ b/src/wireless @@ -86,7 +86,7 @@ wpa_supplicant_scan_info() { [[ -z "$INTERFACE" ]] && return 1 essids=$(mktemp --tmpdir essid.XXXXXXXX) - wpa_supplicant -B -i"$INTERFACE" -Dnl80211,wext -C/var/run/wpa_supplicant -P/var/run/wpa_supplicant.pid || return 1 + wpa_supplicant -B -i"$INTERFACE" -Dnl80211,wext -C/run/wpa_supplicant -P/run/wpa_supplicant.pid || return 1 wpa_cli -i "$INTERFACE" scan &> /dev/null sleep 2.5 wpa_cli -i "$INTERFACE" scan_results | @@ -104,7 +104,7 @@ wpa_supplicant_scan_info() { # Re-sort by strength as the removal disorders the list # Cut to the AP/essid fields only - kill "$(cat /var/run/wpa_supplicant.pid)" + kill "$(cat /run/wpa_supplicant.pid)" # File of 0 length, ie. no ssid's. if [[ ! -s "$essids" ]]; then |