From 7699be26477ba73ca470658ccec05a55499f7af0 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Mon, 18 Mar 2013 21:59:04 +0100 Subject: Unhardcode paths Remove distribution-specific paths (and allow overrides). --- contrib/PKGBUILD | 1 + src/lib/connections/bond | 2 +- src/lib/connections/bridge | 2 +- src/lib/connections/pppoe | 6 ++++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/contrib/PKGBUILD b/contrib/PKGBUILD index b182b6d..0126bf5 100644 --- a/contrib/PKGBUILD +++ b/contrib/PKGBUILD @@ -16,6 +16,7 @@ optdepends=('dialog: for the menu based wifi assistant' 'wpa_actiond: for automatic wireless connections through netctl-auto' 'ifenslave: for bond connections' 'bridge-utils: for bridge connections' + 'ppp: for pppoe connections' ) conflicts=("netcfg") source=(ftp://ftp.archlinux.org/other/packages/netctl/netctl-${pkgver}.tar.xz{,.sig}) diff --git a/src/lib/connections/bond b/src/lib/connections/bond index 09e51c6..379e272 100644 --- a/src/lib/connections/bond +++ b/src/lib/connections/bond @@ -2,7 +2,7 @@ . "$SUBR_DIR/ip" -IFENSLAVE="/sbin/ifenslave" +: ${IFENSLAVE:=ifenslave} bond_up() { if is_interface "$Interface"; then diff --git a/src/lib/connections/bridge b/src/lib/connections/bridge index 929a76b..f33295d 100644 --- a/src/lib/connections/bridge +++ b/src/lib/connections/bridge @@ -2,7 +2,7 @@ . "$SUBR_DIR/ip" -BRCTL="/usr/sbin/brctl" +: ${BRCTL:=brctl} bridge_up() { if is_interface "$Interface"; then diff --git a/src/lib/connections/pppoe b/src/lib/connections/pppoe index b24b503..2578af7 100644 --- a/src/lib/connections/pppoe +++ b/src/lib/connections/pppoe @@ -1,5 +1,7 @@ # Contributed by: Thomas Bächler +: ${PPPD:=pppd} + _quotestring() { echo "\"${1/\"/\\\"}\"" } @@ -43,8 +45,8 @@ pppoe_up() { [[ -n ${PPPoEMAC} ]] && echo "pppoe-mac $(_quotestring "${PPPoEMAC}")" >> "${cfg}" [[ ${PPPoEIP6} == yes ]] && echo "+ipv6" >> "${cfg}" - /sbin/ip link set dev "${Interface}" up - /usr/sbin/pppd file "${cfg}" + ip link set dev "${Interface}" up + $PPPD file "${cfg}" if [[ $? -ne 0 ]]; then rm "${cfg}" -- cgit v1.2.3-24-g4f1b