From 4ed88705b8ea1dae9adc109b71ef35624a9faccd Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Sat, 3 Mar 2012 20:11:43 +0100 Subject: Remove deprecated code Remove some code that should not be used anymore. A 2.7 release seems the right point for some minor interface breaking. --- src/connections/ethernet | 21 ++++----------------- src/connections/openvpn | 8 -------- src/connections/wireless | 7 ------- 3 files changed, 4 insertions(+), 32 deletions(-) (limited to 'src/connections') diff --git a/src/connections/ethernet b/src/connections/ethernet index 8be3c6f..8665816 100644 --- a/src/connections/ethernet +++ b/src/connections/ethernet @@ -44,7 +44,7 @@ ethernet_up() { [[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf" [[ -z "$WPA_DRIVER" ]] && WPA_DRIVER="wired" # Set wpa_supplicant control path (FS#25473) - WPA_CTRL_PATH=/var/run/wpa_supplicant + WPA_CTRL_PATH=/run/wpa_supplicant if grep "^ *ctrl_interface=" "$WPA_CONF" &>/dev/null; then WPA_CTRL_PATH=$(grep -m 1 "^ *ctrl_interface=" "$WPA_CONF" | tail -n 1 | cut -d= -f 2- | sed -r 's/DIR=(.*) +GROUP=.*/\1/') fi @@ -79,9 +79,9 @@ ethernet_up() { fi else # Clear remaining pid files. - rm -f "/var/run/dhcpcd-$INTERFACE".{pid,cache} >/dev/null 2>&1 + rm -f "/run/dhcpcd-$INTERFACE".{pid,cache} >/dev/null 2>&1 # If using own dns, tell dhcpcd to NOT replace resolv.conf - [[ -n "$DNS1" || -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS" + [[ -n "$DNS" ]] && DHCP_OPTIONS="-C resolv.conf $DHCP_OPTIONS" # Start dhcpcd report_debug ethernet_up dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE" dhcpcd -qL -t "${DHCP_TIMEOUT:-10}" $DHCP_OPTIONS "$INTERFACE" 2>&1 | report_debug "$(cat)" @@ -100,12 +100,6 @@ ethernet_up() { report_iproute "Could not configure interface" fi fi - if [[ -n "$IFOPTS" ]]; then - if ! ifconfig "$INTERFACE" $IFOPTS up; then - report_iproute "Bringing interface up failed." - return 1 - fi - fi if [[ -n "$ROUTES" ]]; then for route in "${ROUTES[@]}"; do report_debug ethernet_iproute_up ip route add $route dev "$INTERFACE" @@ -219,16 +213,9 @@ ethernet_up() { : >/etc/resolv.conf [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc/resolv.conf [[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc/resolv.conf - for dns in "${DNS[@]}"; do echo "nameserver $dns" >>/etc/resolv.conf done - elif [[ -n "$DNS1" ]]; then # support older 'ethernet' syntax. - : >/etc/resolv.conf - [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc/resolv.conf - [[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc/resolv.conf - [[ -n "$DNS1" ]] && echo "nameserver $DNS1" >>/etc/resolv.conf - [[ -n "$DNS2" ]] && echo "nameserver $DNS2" >>/etc/resolv.conf fi return 0 @@ -247,7 +234,7 @@ ethernet_down() { /bin/kill $(cat /run/dhclient-$INTERFACE.pid) &>/dev/null fi else - if [[ -f "/var/run/dhcpcd-$INTERFACE.pid" ]]; then + if [[ -f "/run/dhcpcd-$INTERFACE.pid" ]]; then report_debug ethernet_down dhcpcd -qk "$INTERFACE" dhcpcd -qk "$INTERFACE" &>/dev/null fi diff --git a/src/connections/openvpn b/src/connections/openvpn index ded6bf5..cb0adde 100644 --- a/src/connections/openvpn +++ b/src/connections/openvpn @@ -25,17 +25,9 @@ openvpn_up() { : >/etc/resolv.conf [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc/resolv.conf [[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc/resolv.conf - for dns in "${DNS[@]}"; do echo "nameserver $dns" >>/etc/resolv.conf done - elif [[ -n "$DNS1" ]]; then # support older 'ethernet' syntax. - [[ -e /etc/resolv.conf ]] && cp /etc/resolv.conf /tmp/openvpn-$1-resolv.conf - : >/etc/resolv.conf - [[ -n "$DOMAIN" ]] && echo "domain $DOMAIN" >>/etc/resolv.conf - [[ -n "$SEARCH" ]] && echo "search $SEARCH" >>/etc/resolv.conf - [[ -n "$DNS1" ]] && echo "nameserver $DNS1" >>/etc/resolv.conf - [[ -n "$DNS2" ]] && echo "nameserver $DNS2" >>/etc/resolv.conf fi } diff --git a/src/connections/wireless b/src/connections/wireless index f08ba43..2e371c9 100644 --- a/src/connections/wireless +++ b/src/connections/wireless @@ -62,13 +62,6 @@ wireless_up() { report_debug wireless_up stop_wpa "$INTERFACE" stop_wpa "$INTERFACE" - # Manually set iwconfig options (DEPRECATED) - if [[ -n "$IWCONFIG" ]]; then - report_warn "The use of IWCONFIG option is deprecated." - report_debug wireless_up iwconfig "$INTERFACE" $IWCONFIG - iwconfig "$INTERFACE" $IWCONFIG - fi - # Build configuration file case "$SECURITY" in wpa-config) -- cgit v1.2.3-24-g4f1b