From 4278b9e04952c24b14ce5eb3b5ed25885129a859 Mon Sep 17 00:00:00 2001 From: James Rayner Date: Thu, 18 Dec 2008 22:06:56 +1100 Subject: Arrange tree for future packaging --- contrib/net-auto | 43 -------------------------------- contrib/netcfg-auto-wireless | 58 -------------------------------------------- 2 files changed, 101 deletions(-) delete mode 100755 contrib/net-auto delete mode 100755 contrib/netcfg-auto-wireless (limited to 'contrib') diff --git a/contrib/net-auto b/contrib/net-auto deleted file mode 100755 index add6711..0000000 --- a/contrib/net-auto +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -. /etc/rc.conf -. /etc/rc.d/functions - -case "$1" in - start) - # Ensure any device renaming has occurred as intended - for daemon in "${DAEMONS[@]}"; do - if [ "$daemon" = "${daemon#!}" -a "$daemon" = "net-rename" ]; then - if ck_daemon net-rename; then - /etc/rc.d/net-rename start - fi - fi - done - - for network in ${AUTO_NETWORKS[@]}; do - case $network in - auto-*) # Automatic configuration, store type and get interface next - auto=$network - ;; - *) # Either interface or profile - if [[ "$auto" ]]; then # Auto set, so interface - /usr/bin/netcfg-$auto $network - unset auto - fi - esac - done - - add_daemon net-auto - ;; - stop) - /usr/bin/netcfg2 -a - rm_daemon net-auto - ;; - restart) - $0 stop; sleep 1; $0 start - ;; - *) - echo "usage: $0 {start|stop|restart}" -esac - -# vim: set ts=4 et sw=4: diff --git a/contrib/netcfg-auto-wireless b/contrib/netcfg-auto-wireless deleted file mode 100755 index e5e4fc1..0000000 --- a/contrib/netcfg-auto-wireless +++ /dev/null @@ -1,58 +0,0 @@ -#! /bin/bash -# Originally contributed by Neuro: http://bbs.archlinux.org/viewtopic.php?pid=278148#p278148 - -. /usr/lib/network/network.subr -. /usr/lib/network/wireless.subr -. /etc/rc.conf -. /etc/rc.d/functions - -# wifi_auto -# autoconnect wireless interface -# $1 - wireless interface -wifi_auto() -{ - interface=$1; RETRIES=6 - stat_busy "Scanning for networks" - - ifconfig $interface up - networks="$(list_networks $interface)" - - if [[ ! "$networks" ]]; then - stat_append "- No networks available." - stat_fail - exit 1 - fi - - # Loop through all the found essid's, then find a matching profile. - while read essid; do - for network in $(list_profiles); do - load_profile $network - if [[ "$CONNECTION" = "wireless" && "$essid" = "$ESSID" && "$interface" = "$INTERFACE" ]]; then - found=$network - fi - # Clear out any variables set by the profile - . /usr/lib/network/${CONNECTION}.subr - ${CONNECTION}_clean_scope - done - done < $networks - - if [[ "$found" ]]; then - netcfg2 $found - exit $? - fi - - stat_append "- No profiles matched the found networks" - stat_fail - exit 1 -} - -if [[ $(id -u) -ne 0 ]]; then - err "This script needs to be run with root priviledges" - exit 1 -fi -if [[ -z $1 ]]; then - err "Please supply an interface to connect" - exit 1 -fi -wifi_auto $1 - -- cgit v1.2.3-24-g4f1b