diff options
author | Rémy Oudompheng <remy@archlinux.org> | 2011-08-20 13:13:35 +0200 |
---|---|---|
committer | Rémy Oudompheng <remy@archlinux.org> | 2011-08-20 13:13:35 +0200 |
commit | 1227a80b24c943438757e933bd568ceddd00479b (patch) | |
tree | e88638495f85726377dfa6cf4279ab31c3f54534 /wpa_actiond | |
parent | ec0e041a8eab919abef8e3af289c979ee1737382 (diff) | |
download | netctl-1227a80b24c943438757e933bd568ceddd00479b.tar.gz netctl-1227a80b24c943438757e933bd568ceddd00479b.tar.xz |
Reorganize files to match install location closer
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
Diffstat (limited to 'wpa_actiond')
-rwxr-xr-x | wpa_actiond/net-auto-wireless | 65 | ||||
-rw-r--r-- | wpa_actiond/net-auto-wireless.service | 14 | ||||
-rwxr-xr-x | wpa_actiond/netcfg-wpa_actiond | 90 | ||||
-rwxr-xr-x | wpa_actiond/netcfg-wpa_actiond-action | 54 |
4 files changed, 0 insertions, 223 deletions
diff --git a/wpa_actiond/net-auto-wireless b/wpa_actiond/net-auto-wireless deleted file mode 100755 index d6a3c44..0000000 --- a/wpa_actiond/net-auto-wireless +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -. /etc/rc.conf -. /etc/rc.d/functions -. /usr/lib/network/globals -. /etc/conf.d/netcfg - -if [[ ! -x /usr/sbin/wpa_actiond ]]; then - echo "Please install 'wpa_actiond' to use net-auto-wireless" - exit 1 -fi - -if [ -z "${WIRELESS_INTERFACE}" ]; then - echo "No interface name set. Add to /etc/conf.d/netcfg a line" - echo " WIRELESS_INTERFACE=\"your_interface\"" - exit 1 -fi - -case "$1" in - start) - if ! ck_daemon net-auto-wireless; then - exit_stderr "net-auto-wireless has already been started: try \"/etc/rc.d/net-auto-wireless restart\"" - fi - # Ensure any device renaming has occurred as intended - for daemon in "${DAEMONS[@]}"; do - if [[ "$daemon" = "${daemon#!}" && "$daemon" = "net-rename" ]]; then - if ck_daemon net-rename; then - /etc/rc.d/net-rename start - fi - fi - done - - stat_busy "Starting netcfg auto-wireless mode for interface ${WIRELESS_INTERFACE}" - /usr/bin/netcfg-wpa_actiond "${WIRELESS_INTERFACE}" >/dev/null - if [ $? -eq 0 ]; then - add_daemon net-auto-wireless - stat_done - else - stat_fail - fi - ;; - stop) - if ! ck_daemon net-auto-wireless; then - stat_busy "Stopping netcfg auto-wireless mode for interface ${WIRELESS_INTERFACE}" - /usr/bin/netcfg-wpa_actiond stop "${WIRELESS_INTERFACE}" >/dev/null - if [ $? -eq 0 ]; then - rm_daemon net-auto-wireless - stat_done - else - stat_fail - fi - fi - ;; - restart) - "$0" stop - sleep 1 - "$0" start - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 - ;; -esac -exit 0 -# vim: ft=sh ts=4 et sw=4: diff --git a/wpa_actiond/net-auto-wireless.service b/wpa_actiond/net-auto-wireless.service deleted file mode 100644 index 7075cb5..0000000 --- a/wpa_actiond/net-auto-wireless.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Provides automatic netcfg wireless connection -After=dbus.service - -[Service] -EnvironmentFile=/etc/rc.conf -EnvironmentFile=/etc/conf.d/netcfg -ExecStart=/usr/bin/netcfg-wpa_actiond $WIRELESS_INTERFACE -ExecStop=/usr/bin/netcfg-wpa_actiond stop $WIRELESS_INTERFACE -RemainAfterExit=yes -Type=forking - -[Install] -WantedBy=network.target diff --git a/wpa_actiond/netcfg-wpa_actiond b/wpa_actiond/netcfg-wpa_actiond deleted file mode 100755 index bb144c3..0000000 --- a/wpa_actiond/netcfg-wpa_actiond +++ /dev/null @@ -1,90 +0,0 @@ -#! /bin/bash -. /usr/lib/network/network -. $SUBR_DIR/8021x -. $SUBR_DIR/rfkill -. /etc/rc.conf -. /etc/conf.d/netcfg - -AUTOWIFI="/usr/sbin/wpa_actiond -p /run/wpa_supplicant" -ACTION_SCRIPT="/usr/bin/netcfg-wpa_actiond-action" - -case $1 in - help) - echo "netcfg-wpa_actiond <interface>" - echo "netcfg-wpa_actiond stop <interface>" - exit - ;; - stop) - [[ -z $2 ]] && echo "Please specify an interface to stop" && exit 1 - interface=$2 - [[ -f "$IFACE_DIR/$interface" ]] && source "$IFACE_DIR/$interface" - netcfg -i "$interface" - stop_wpa "$interface" - kill $(cat "/run/wpa_actiond_${2}.pid") - # only try to disable software rfkill switches (FS#25514) - if [[ "$RFKILL" == "soft" ]]; then - set_rf_state "$interface" disabled $RFKILL_NAME || exit $? - fi - exit - ;; - *) - interface=$1; shift - PIDFILE="/run/wpa_actiond_${interface}.pid" - EXTRA_AUTOWIFI_OPTIONS="$*" - ;; -esac - -if [[ -z $interface ]]; then - echo "No interface specified" - exit 1 -fi - -# Load interface specific config -[[ -f "$IFACE_DIR/$interface" ]] && source "$IFACE_DIR/$interface" - -if [[ -f "$CONN_DIR/interfaces/$interface" ]]; then - netcfg -i $interface -fi - -if [[ -n "$RFKILL" ]]; then # Enable radio if necessary - enable_rf $interface $RFKILL $RFKILL_NAME || exit $? -fi - -WPA_CONF="$(make_wpa_config_file $interface)" - -if [[ -n "${AUTO_PROFILES}" ]]; then - for prof in ${AUTO_PROFILES}; do echo $prof; done -else - list_profiles -fi | while read profile; do - echo "$profile" - ( - load_profile "$profile" - - [[ $CONNECTION != "wireless" ]] && exit 1 - [[ $INTERFACE != $interface ]] && exit 1 - # Exclude wpa-config, the wpa_conf is 'complete' and doesn't fit in this scheme - [[ -z "$SECURITY" ]] && SECURITY="none" - [[ $SECURITY == "wpa-config" ]] && exit 1 - - config=$(make_wpa_config) - - echo -e "network={ \n$config \nid_str=\"$profile\" \n}" >> $WPA_CONF - ) -done - - -[[ -z $WPA_DRIVER ]] && WPA_DRIVER="nl80211,wext" -WPA_OPTS="-W $WPA_OPTS" - -# Kill any existing wpa_supplicant on this interface -stop_wpa "$interface" - -if start_wpa $interface $WPA_CONF $WPA_DRIVER $WPA_OPTS; then - if $AUTOWIFI -i ${interface} -P ${PIDFILE} -a ${ACTION_SCRIPT} ${EXTRA_AUTOWIFI_OPTIONS}; then - exit 0 - fi -fi - -exit 1 - diff --git a/wpa_actiond/netcfg-wpa_actiond-action b/wpa_actiond/netcfg-wpa_actiond-action deleted file mode 100755 index 3547fef..0000000 --- a/wpa_actiond/netcfg-wpa_actiond-action +++ /dev/null @@ -1,54 +0,0 @@ -#! /bin/bash - -interface="$1" -ssid="$2" -profile="$3" -action="$4" - -. /usr/lib/network/network -[[ "$profile" ]] && load_profile "$profile" - -case $action in - CONNECT) - if [[ -z $profile ]]; then - dhcpcd "$interface" - exit $? - fi - if ! $CONN_DIR/ethernet up "$profile"; then - exit 1 # what to do if fail? - fi - - set_profile up "$profile" - - if ! ( eval $POST_UP ); then # JP: sandbox the eval - # failing POST_UP will take interface down - "$CONN_DIR/$ethernet" down "$profile" - exit 1 - fi - ;; - DISCONNECT) - if [[ -z $profile ]]; then - dhcpcd -k "$interface" - exit $? - fi - if ! ( eval $PRE_DOWN ); then # JP: sandbox the eval - exit 1 - fi - if ! "$CONN_DIR/ethernet" down "$profile"; then - exit 1 - fi - if ! ( eval $POST_DOWN ); then # JP: sandbox the eval - exit 1 - fi - set_profile down "$profile" - ;; - LOST|REESTABLISHED) - # Not handled. - exit 0 - ;; - *) - # ??? - exit 1 - ;; -esac - |