diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2012-09-15 15:43:41 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2012-09-15 16:07:30 +0200 |
commit | f98469bcd24b8f4aa8a65d5728fe737b132ae310 (patch) | |
tree | 2f671a3a18eb00a1cca9130c554c4a436fc26e9a /src/connections | |
parent | 128cd8d55e8fca8e0cb1678eda1746cd5e320915 (diff) | |
download | netctl-f98469bcd24b8f4aa8a65d5728fe737b132ae310.tar.gz netctl-f98469bcd24b8f4aa8a65d5728fe737b132ae310.tar.xz |
Un-hardcode the interface in pppoe
This bug was discovered by Gala Dragos.
Quotation is updated on the go.
Diffstat (limited to 'src/connections')
-rw-r--r-- | src/connections/pppoe | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/connections/pppoe b/src/connections/pppoe index 0ce123c..65a162d 100644 --- a/src/connections/pppoe +++ b/src/connections/pppoe @@ -9,9 +9,9 @@ pppoe_up() { local cfg load_profile "$1" - mkdir -p "$STATE_DIR"/pppoe.eth0."$1"/ - chmod 700 "$STATE_DIR"/pppoe.eth0."$1"/ - cfg="$STATE_DIR"/pppoe.eth0."$1"/options + mkdir -p "$STATE_DIR/pppoe.${INTERFACE}.$1/" + chmod 700 "$STATE_DIR/pppoe.${INTERFACE}.$1/" + cfg="$STATE_DIR/pppoe.${INTERFACE}.$1/options" : > "${cfg}" chmod 600 "${cfg}" @@ -44,12 +44,12 @@ pppoe_up() { [[ -n ${PPPOE_SESSION} ]] && echo "rp_pppoe_sess $(_quotestring "${PPPOE_SESSION}")" >> "${cfg}" [[ -n ${PPPOE_MAC} ]] && echo "pppoe-mac $(_quotestring "${PPPOE_MAC}")" >> "${cfg}" - /sbin/ip link set dev ${INTERFACE} up + /sbin/ip link set dev "${INTERFACE}" up /usr/sbin/pppd file "${cfg}" if [[ $? -ne 0 ]]; then rm "${cfg}" - rmdir "$STATE_DIR"/pppoe.eth0."$1"/ + rmdir "$STATE_DIR/pppoe.${INTERFACE}.$1/" report_fail "Couldn't make pppd connection." return 1 fi @@ -58,7 +58,7 @@ pppoe_up() { pppoe_down() { load_profile "$1" local cfg - cfg="$STATE_DIR"/pppoe.eth0."$1"/options + cfg="$STATE_DIR/pppoe.${INTERFACE}.$1/options" PIDFILE="/var/run/ppp-$1.pid" if [[ -e $PIDFILE ]]; then @@ -67,7 +67,7 @@ pppoe_down() { fi rm "${cfg}" - rmdir "$STATE_DIR"/pppoe.eth0."$1"/ + rmdir "$STATE_DIR/pppoe.${INTERFACE}.$1/" } pppoe_$1 "$2" |