diff options
-rw-r--r-- | net/adsl.sh | 8 | ||||
-rw-r--r-- | net/apipa.sh | 2 | ||||
-rw-r--r-- | net/arping.sh | 4 | ||||
-rw-r--r-- | net/bonding.sh | 4 | ||||
-rw-r--r-- | net/clip.sh | 6 | ||||
-rw-r--r-- | net/dhclient.sh | 8 | ||||
-rw-r--r-- | net/dhclientv6.sh | 8 | ||||
-rw-r--r-- | net/ifconfig.sh.BSD.in | 2 | ||||
-rw-r--r-- | net/ifconfig.sh.Linux.in | 2 | ||||
-rw-r--r-- | net/ifplugd.sh | 6 | ||||
-rw-r--r-- | net/ifwatchd.sh.BSD.in | 8 | ||||
-rw-r--r-- | net/ipppd.sh | 6 | ||||
-rw-r--r-- | net/iw.sh | 2 | ||||
-rw-r--r-- | net/iwconfig.sh.BSD.in | 2 | ||||
-rw-r--r-- | net/iwconfig.sh.Linux.in | 2 | ||||
-rw-r--r-- | net/macchanger.sh | 4 | ||||
-rw-r--r-- | net/netplugd.sh | 6 | ||||
-rw-r--r-- | net/pppd.sh | 12 | ||||
-rw-r--r-- | net/pump.sh | 4 | ||||
-rw-r--r-- | net/system.sh | 2 | ||||
-rw-r--r-- | net/udhcpc.sh.Linux.in | 10 | ||||
-rw-r--r-- | net/wireguard.sh | 6 | ||||
-rw-r--r-- | net/wpa_supplicant.sh | 13 | ||||
-rw-r--r-- | sh/udhcpc-hook.sh.in | 4 |
24 files changed, 61 insertions, 70 deletions
diff --git a/net/adsl.sh b/net/adsl.sh index 7724710..fe48454 100644 --- a/net/adsl.sh +++ b/net/adsl.sh @@ -5,7 +5,7 @@ adsl_depend() { - program /usr/sbin/adsl-start /usr/sbin/pppoe-start + program adsl-start pppoe-start before dhcp } @@ -13,11 +13,11 @@ adsl_setup_vars() { local startstop="$1" cfgexe= - if [ -x /usr/sbin/pppoe-start ]; then - exe="/usr/sbin/pppoe-${startstop}" + if command -v pppoe-start >/dev/null; then + exe="pppoe-${startstop}" cfgexe=pppoe-setup else - exe="/usr/sbin/adsl-${startstop}" + exe="adsl-${startstop}" cfgexe=adsl-setup fi diff --git a/net/apipa.sh b/net/apipa.sh index a124b84..7ccdad0 100644 --- a/net/apipa.sh +++ b/net/apipa.sh @@ -3,7 +3,7 @@ apipa_depend() { - program /sbin/arping /bin/arping + program arping } _random_uint16() diff --git a/net/arping.sh b/net/arping.sh index bdd8284..fbda9c8 100644 --- a/net/arping.sh +++ b/net/arping.sh @@ -4,7 +4,7 @@ arping_depend() { - program /sbin/arping /bin/arping /usr/bin/arping /usr/sbin/arping /usr/sbin/arping2 + program arping arping2 before interface } @@ -26,7 +26,7 @@ arping_address() eval w=\$arping_wait_${IFVAR} [ -z "${w}" ] && w=${arping_wait:-5} - if type arping2 >/dev/null 2>&1; then + if command -v arping2 >/dev/null; then if [ -n "${spoof}" ]; then opts="${opts} -S ${spoof}" else diff --git a/net/bonding.sh b/net/bonding.sh index 6db90fa..d8f48d8 100644 --- a/net/bonding.sh +++ b/net/bonding.sh @@ -6,11 +6,11 @@ bonding_depend() { before interface macchanger - program ip /sbin/ifconfig /bin/ifconfig + program ip ifconfig # If you do not have sysfs, you MUST have this binary instead for ioctl # Also you will loose some functionality that cannot be done via sysfs: if [ ! -d /sys/class/net ]; then - program /sbin/ifenslave + program ifenslave fi local netns diff --git a/net/clip.sh b/net/clip.sh index 96bfe6e..e853e68 100644 --- a/net/clip.sh +++ b/net/clip.sh @@ -4,7 +4,7 @@ clip_depend() { - program /usr/sbin/atmsigd + program atmsigd before interface } @@ -23,7 +23,7 @@ atmclip_svc_start() start-stop-daemon --start \ --background \ --make-pidfile --pidfile "/run/$1.pid" \ - --exec "/usr/sbin/$1" -- -l syslog + --exec "$1" -- -l syslog eend $? } @@ -51,7 +51,7 @@ atmclip_svc_stop() ebegin "Stopping $2 Daemon ($1)" start-stop-daemon --stop --quiet \ --pidfile "/run/$1.pid" \ - --exec "/usr/sbin/$1" + --exec "$1" eend $? } diff --git a/net/dhclient.sh b/net/dhclient.sh index 24c3512..6fa4a92 100644 --- a/net/dhclient.sh +++ b/net/dhclient.sh @@ -5,7 +5,7 @@ dhclient_depend() { after interface - program start /sbin/dhclient + program start dhclient provide dhcp # We prefer dhclient over these @@ -48,7 +48,7 @@ dhclient_start() # Bring up DHCP for this interface ebegin "Running dhclient" - echo "${dhconf}" | start-stop-daemon --start --exec /sbin/dhclient \ + echo "${dhconf}" | start-stop-daemon --start --exec dhclient \ --pidfile "${pidfile}" \ -- ${args} -q -1 -pf "${pidfile}" "${IFACE}" eend $? || return 1 @@ -63,7 +63,7 @@ dhclient_stop() [ ! -f "${pidfile}" ] && return 0 # Get our options - if [ -x /sbin/dhclient ]; then + if command -v dhclient >/dev/null; then eval opts=\$dhcp_${IFVAR} [ -z "${opts}" ] && opts=${dhcp} fi @@ -73,7 +73,7 @@ dhclient_stop() *" release "*) dhclient -q -r -pf "${pidfile}" "${IFACE}";; *) start-stop-daemon --stop --quiet \ - --exec /sbin/dhclient --pidfile "${pidfile}" + --exec dhclient --pidfile "${pidfile}" ;; esac eend $? diff --git a/net/dhclientv6.sh b/net/dhclientv6.sh index f87ed4d..f8b0a83 100644 --- a/net/dhclientv6.sh +++ b/net/dhclientv6.sh @@ -4,7 +4,7 @@ dhclientv6_depend() { after interface - program start /sbin/dhclient + program start dhclient provide dhcpv6 } @@ -50,7 +50,7 @@ dhclientv6_start() # Bring up DHCP for this interface ebegin "Running dhclient -6" - echo "${dhconf}" | start-stop-daemon --start --exec /sbin/dhclient \ + echo "${dhconf}" | start-stop-daemon --start --exec dhclient \ --pidfile "${pidfile}" \ -- -6 ${args} -q -1 -pf "${pidfile}" "${IFACE}" eend $? || return 1 @@ -65,7 +65,7 @@ dhclientv6_stop() [ ! -f "${pidfile}" ] && return 0 # Get our options - if [ -x /sbin/dhclient ]; then + if command -v dhclient >/dev/null; then eval opts=\$dhcp_${IFVAR} [ -z "${opts}" ] && opts=${dhcp} fi @@ -75,7 +75,7 @@ dhclientv6_stop() *" release "*) dhclient -6 -q -r -pf "${pidfile}" "${IFACE}";; *) start-stop-daemon --stop --quiet \ - --exec /sbin/dhclient --pidfile "${pidfile}" + --exec dhclient --pidfile "${pidfile}" ;; esac eend $? diff --git a/net/ifconfig.sh.BSD.in b/net/ifconfig.sh.BSD.in index ff0d17e..54c44a5 100644 --- a/net/ifconfig.sh.BSD.in +++ b/net/ifconfig.sh.BSD.in @@ -4,7 +4,7 @@ ifconfig_depend() { - program /sbin/ifconfig + program ifconfig provide interface } diff --git a/net/ifconfig.sh.Linux.in b/net/ifconfig.sh.Linux.in index b0a4551..adbd3c3 100644 --- a/net/ifconfig.sh.Linux.in +++ b/net/ifconfig.sh.Linux.in @@ -4,7 +4,7 @@ ifconfig_depend() { - program /sbin/ifconfig /bin/ifconfig + program ifconfig provide interface } diff --git a/net/ifplugd.sh b/net/ifplugd.sh index 01e84e4..8a0b608 100644 --- a/net/ifplugd.sh +++ b/net/ifplugd.sh @@ -6,7 +6,7 @@ _config_vars="$_config_vars plug_timeout" ifplugd_depend() { - program start /usr/sbin/ifplugd + program start ifplugd after macnet rename before interface provide plug @@ -46,7 +46,7 @@ ifplugd_pre_start() mark_service_inactive # Start ifplugd - eval start-stop-daemon --start --exec /usr/sbin/ifplugd \ + eval start-stop-daemon --start --exec ifplugd \ --pidfile "${pidfile}" -- "${args}" --iface="${IFACE}" eend $? || return 1 @@ -89,7 +89,7 @@ ifplugd_stop() [ ! -e "${pidfile}" ] && return 0 ebegin "Stopping ifplugd on ${IFACE}" - start-stop-daemon --stop --quiet --exec /usr/sbin/ifplugd \ + start-stop-daemon --stop --quiet --exec ifplugd \ --pidfile "${pidfile}" --signal QUIT eend $? } diff --git a/net/ifwatchd.sh.BSD.in b/net/ifwatchd.sh.BSD.in index c706baa..aa299cb 100644 --- a/net/ifwatchd.sh.BSD.in +++ b/net/ifwatchd.sh.BSD.in @@ -6,7 +6,7 @@ _config_vars="$_config_vars plug_timeout" ifwatchd_depend() { - program start /usr/sbin/ifwatchd + program start ifwatchd after macnet rename wireless before interface provide plug @@ -33,7 +33,7 @@ ifwatchd_pre_start() # Start ifwatchd IN_BACKGROUND=yes ; export IN_BACKGROUND - start-stop-daemon --start --exec /usr/sbin/ifwatchd \ + start-stop-daemon --start --exec ifwatchd \ -- -c "@LIBEXECDIR@/sh/ifwatchd-carrier.sh" \ -n "@LIBEXECDIR@/sh/ifwatchd-nocarrier.sh" "${IFACE}" unset IN_BACKGROUND @@ -47,13 +47,13 @@ ifwatchd_stop() { yesno ${IN_BACKGROUND} && return 0 - start-stop-daemon --test --quiet --stop --exec /usr/sbin/ifwatchd \ + start-stop-daemon --test --quiet --stop --exec ifwatchd \ -- -c "@LIBEXECDIR@/sh/ifwatchd-carrier.sh" \ -n "@LIBEXECDIR@/sh/ifwatchd-nocarrier.sh" "${IFACE}" \ || return 0 ebegin "Stopping ifwatchd on" "${IFACE}" - start-stop-daemon --stop --exec /usr/sbin/ifwatchd \ + start-stop-daemon --stop --exec ifwatchd \ -- -c "@LIBEXECDIR@/sh/ifwatchd-carrier.sh" \ -n "@LIBEXECDIR@/sh/ifwatchd-nocarrier.sh" "${IFACE}" eend $? diff --git a/net/ipppd.sh b/net/ipppd.sh index 57c20a4..32a0612 100644 --- a/net/ipppd.sh +++ b/net/ipppd.sh @@ -4,7 +4,7 @@ ipppd_depend() { - program start /usr/sbin/ipppd + program start ipppd after macnet before interface provide isdn @@ -29,7 +29,7 @@ ipppd_pre_start() eval opts=\$ipppd_${IFVAR} einfo "Starting ipppd for ${IFACE}" - start-stop-daemon --start --exec /usr/sbin/ipppd \ + start-stop-daemon --start --exec ipppd \ --pidfile "${pidfile}" \ -- ${opts} pidfile "${pidfile}" \ file "/etc/ppp/options.${IFACE}" >/dev/null @@ -43,7 +43,7 @@ ipppd_post_stop() [ ! -f "${pidfile}" ] && return 0 einfo "Stopping ipppd for ${IFACE}" - start-stop-daemon --stop --quiet --exec /usr/sbin/ipppd \ + start-stop-daemon --stop --quiet --exec ipppd \ --pidfile "${pidfile}" eend $? } @@ -9,7 +9,7 @@ _config_vars="$_config_vars mesh" iw_depend() { - program /usr/sbin/iw + program iw after plug before interface provide wireless diff --git a/net/iwconfig.sh.BSD.in b/net/iwconfig.sh.BSD.in index 97a1d13..2d8dd52 100644 --- a/net/iwconfig.sh.BSD.in +++ b/net/iwconfig.sh.BSD.in @@ -7,7 +7,7 @@ _config_vars="$_config_vars blacklist_aps" iwconfig_depend() { - program /sbin/ifconfig + program ifconfig after plug before interface provide wireless diff --git a/net/iwconfig.sh.Linux.in b/net/iwconfig.sh.Linux.in index 98044a9..824b0e5 100644 --- a/net/iwconfig.sh.Linux.in +++ b/net/iwconfig.sh.Linux.in @@ -7,7 +7,7 @@ _config_vars="$_config_vars preferred_aps blacklist_aps" iwconfig_depend() { - program /sbin/iwconfig + program iwconfig after plug before interface provide wireless diff --git a/net/macchanger.sh b/net/macchanger.sh index 5b32b80..69bad5f 100644 --- a/net/macchanger.sh +++ b/net/macchanger.sh @@ -64,7 +64,7 @@ macchanger_pre_start() *) opts="${opts} -m ${mac}";; esac - if [ ! -x /usr/bin/macchanger ]; then + if ! command -v macchanger >/dev/null; then eerror "For changing MAC addresses, emerge net-analyzer/macchanger" return 1 fi @@ -72,7 +72,7 @@ macchanger_pre_start() for try in 1 2; do # Sometimes the interface needs to be up [ "${try}" -eq 2 ] && _up - output=$(/usr/bin/macchanger ${opts} "${IFACE}") + output=$(macchanger ${opts} "${IFACE}") rc=$? [ "${rc}" -eq 0 ] && break done diff --git a/net/netplugd.sh b/net/netplugd.sh index 283f312..c0da954 100644 --- a/net/netplugd.sh +++ b/net/netplugd.sh @@ -6,7 +6,7 @@ _config_vars="$_config_vars plug_timeout" netplugd_depend() { - program start /sbin/netplugd + program start netplugd after macnet rename before interface provide plug @@ -47,7 +47,7 @@ netplugd_pre_start() mark_service_inactive # Start netplug - start-stop-daemon --start --exec /sbin/netplugd \ + start-stop-daemon --start --exec netplugd \ --pidfile "${pidfile}" \ -- -i "${IFACE}" -P -p "${pidfile}" -c /dev/null eend "$?" || return 1 @@ -91,7 +91,7 @@ netplugd_stop() [ ! -e "${pidfile}" ] && return 0 ebegin "Stopping netplug on" "${IFACE}" - start-stop-daemon --stop --quiet --exec /sbin/netplugd \ + start-stop-daemon --stop --quiet --exec netplugd \ --pidfile "${pidfile}" eend $? } diff --git a/net/pppd.sh b/net/pppd.sh index 1b14fed..eaec26e 100644 --- a/net/pppd.sh +++ b/net/pppd.sh @@ -5,7 +5,7 @@ pppd_depend() { - program /usr/sbin/pppd + program pppd after interface before dhcp provide ppp @@ -23,7 +23,7 @@ requote() pppd_version_int() { # 002004008 is v2.4.8 - printf '%03d' $(/usr/sbin/pppd --version | awk '/pppd version/ {print $3}' | tr '.' ' ') + printf '%03d' $(pppd --version | awk '/pppd version/ {print $3}' | tr '.' ' ') } pppd_is_ge_248() @@ -153,7 +153,7 @@ pppd_pre_start() opts="unit ${unit} ${opts}" # Setup connect script - local chatprog="/usr/sbin/chat -e -E -v" phone= + local chatprog="chat -e -E -v" phone= eval phone=\$phone_number_${IFVAR} set -- ${phone} [ -n "$1" ] && chatprog="${chatprog} -T '$1'" @@ -230,10 +230,10 @@ pppd_pre_start() if [ -n "${username}" ] \ && [ -n "${password}" -o -z "${passwordset}" ]; then printf "%s" "${password}" | \ - eval start-stop-daemon --start --exec /usr/sbin/pppd \ + eval start-stop-daemon --start --exec pppd \ --pidfile "${pidfile}" -- "${opts}" >/dev/null else - eval start-stop-daemon --start --exec /usr/sbin/pppd \ + eval start-stop-daemon --start --exec pppd \ --pidfile "${pidfile}" -- "${opts}" >/dev/null fi @@ -271,7 +271,7 @@ pppd_stop() # Give pppd at least 30 seconds do die, #147490 einfo "Stopping pppd on ${IFACE}" - start-stop-daemon --stop --quiet --exec /usr/sbin/pppd \ + start-stop-daemon --stop --quiet --exec pppd \ --pidfile "${pidfile}" --retry 30 eend $? } diff --git a/net/pump.sh b/net/pump.sh index 864b6cf..144316f 100644 --- a/net/pump.sh +++ b/net/pump.sh @@ -4,7 +4,7 @@ pump_depend() { - program /sbin/pump + program pump after interface provide dhcp @@ -49,7 +49,7 @@ pump_stop() { # We check for a pump process first as querying for status # causes pump to spawn a process - start-stop-daemon --quiet --test --stop --exec /sbin/pump || return 0 + start-stop-daemon --quiet --test --stop --exec pump || return 0 # Check that pump is running on the interface if ! pump --status --interface "${IFACE}" >/dev/null 2>&1; then diff --git a/net/system.sh b/net/system.sh index 0b65379..518a899 100644 --- a/net/system.sh +++ b/net/system.sh @@ -46,7 +46,7 @@ _system_dns() [ -n "${options}" ] && buffer="${buffer}options ${options}\n" # Support resolvconf if we have it. - if [ -x /sbin/resolvconf ]; then + if command -v resolvconf >/dev/null; then x="-a ${IFACE}" eval imetric=\${metric_${IFVAR}} if [ -n "${imetric}" ]; then diff --git a/net/udhcpc.sh.Linux.in b/net/udhcpc.sh.Linux.in index 53fe5eb..040369c 100644 --- a/net/udhcpc.sh.Linux.in +++ b/net/udhcpc.sh.Linux.in @@ -4,7 +4,7 @@ udhcpc_depend() { - program start /bin/busybox + program start busybox after interface provide dhcp } @@ -56,8 +56,8 @@ udhcpc_start() fi case " ${args} " in - *" --quit "*|*" -q "*) x="/bin/busybox udhcpc";; - *) x="start-stop-daemon --start --exec /bin/busybox \ + *" --quit "*|*" -q "*) x="busybox udhcpc";; + *) x="start-stop-daemon --start --exec busybox \ --pidfile \"${pidfile}\" -- udhcpc";; esac @@ -95,14 +95,14 @@ udhcpc_stop() case " ${opts} " in *" release "*) start-stop-daemon --stop --quiet --signal USR2 \ - --exec /bin/busybox --pidfile "${pidfile}" + --exec busybox --pidfile "${pidfile}" if [ -f /var/cache/udhcpc-"${IFACE}".lease ]; then rm -f /var/cache/udhcpc-"${IFACE}".lease fi ;; esac - start-stop-daemon --stop --exec /bin/busybox --pidfile "${pidfile}" + start-stop-daemon --stop --exec busybox --pidfile "${pidfile}" eend $? if [ -e "/run/udhcpc-${IFACE}.conf" ]; then diff --git a/net/wireguard.sh b/net/wireguard.sh index a9aac69..bb71d6f 100644 --- a/net/wireguard.sh +++ b/net/wireguard.sh @@ -5,7 +5,7 @@ wireguard_depend() { - program /usr/bin/wg + program wg after interface } @@ -25,9 +25,9 @@ wireguard_pre_start() ebegin "Configuring WireGuard interface $IFACE" set -- $(_get_array "wireguard_$IFVAR") if [ $# -eq 1 ]; then - /usr/bin/wg setconf "$IFACE" "$1" + wg setconf "$IFACE" "$1" else - eval /usr/bin/wg set "$IFACE" "$@" + eval wg set "$IFACE" "$@" fi e=$? if [ $e -eq 0 ]; then diff --git a/net/wpa_supplicant.sh b/net/wpa_supplicant.sh index 9f024c0..b508511 100644 --- a/net/wpa_supplicant.sh +++ b/net/wpa_supplicant.sh @@ -42,13 +42,9 @@ fi wpa_supplicant_pre_start() { local opts= cliopts= cfgfile= ctrl_dir= wireless=true - local wpas=/usr/sbin/wpa_supplicant wpac=/usr/bin/wpa_cli + local wpas=wpa_supplicant wpac=wpa_cli local actfile=/etc/wpa_supplicant/wpa_cli.sh - if [ ! -x "${wpas}" ]; then - wpas=/sbin/wpa_supplicant - wpac=/bin/wpa_cli - fi [ "${RC_UNAME}" = "Linux" ] || unset wpac [ -e "${actfile}" ] || unset wpac @@ -182,12 +178,7 @@ wpa_supplicant_pre_start() wpa_supplicant_post_stop() { - local wpas=/usr/sbin/wpa_supplicant wpac=/usr/bin/wpa_cli - - if [ ! -x "${wpas}" ]; then - wpas=/sbin/wpa_supplicant - wpac=/bin/wpa_cli - fi + local wpas=wpa_supplicant wpac=wpa_cli if yesno "${IN_BACKGROUND}"; then # Only stop wpa_supplicant if it's not the controlling daemon diff --git a/sh/udhcpc-hook.sh.in b/sh/udhcpc-hook.sh.in index e4300c1..85ea09d 100644 --- a/sh/udhcpc-hook.sh.in +++ b/sh/udhcpc-hook.sh.in @@ -19,7 +19,7 @@ update_dns() for i in ${dns} ; do conf="${conf}nameserver ${i}\n" done - if [ -x /sbin/resolvconf ] ; then + if command -v resolvconf >/dev/null; then printf "${conf}" | resolvconf -a ${interface} else printf "${conf}" > /etc/resolv.conf @@ -110,7 +110,7 @@ deconfig() fi if ! peer_var "${PEER_DNS}" ; then - [ -x /sbin/resolvconf ] && resolvconf -d "${interface}" + command -v resolvconf >/dev/null && resolvconf -d "${interface}" fi } |