summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-04 19:58:14 -0400
committerTom Gundersen <teg@jklm.no>2011-06-05 02:25:32 +0200
commit71ef9c40189ff87d84c7bf354fb43038997913d1 (patch)
treedaaae1c2b39ed6df222ed20c7861ef010cbf30b1
parentc6adbe7a36a7330debfaa07d4351bcd80d479214 (diff)
remove absolute paths from daemons and rc.d
These are run from a context where PATH will be set, so defining absolute paths is unnecessary.
-rwxr-xr-xadjtime2
-rwxr-xr-xhwclock6
-rwxr-xr-xnetwork60
-rwxr-xr-xrc.d2
4 files changed, 35 insertions, 35 deletions
diff --git a/adjtime b/adjtime
index 8a894f1..6a825ca 100755
--- a/adjtime
+++ b/adjtime
@@ -11,5 +11,5 @@ case $HARDWARECLOCK in
esac
if [[ $HWCLOCK_PARAMS && -f /run/daemons/hwclock ]]; then
- /sbin/hwclock $HWCLOCK_PARAMS
+ hwclock $HWCLOCK_PARAMS
fi
diff --git a/hwclock b/hwclock
index d9de9e1..117ab14 100755
--- a/hwclock
+++ b/hwclock
@@ -13,9 +13,9 @@ case "$1" in
start)
if [[ $HWCLOCK_PARAMS ]]; then
status "Adjusting Hardware Clock" \
- /sbin/hwclock --adjust
+ hwclock --adjust
stat_busy "Setting System Clock"
- /sbin/hwclock --hctosys $HWCLOCK_PARAMS || stat_die
+ hwclock --hctosys $HWCLOCK_PARAMS || stat_die
stat_done
# Note: This also enables /etc/cron.hourly/adjtime
add_daemon hwclock
@@ -24,7 +24,7 @@ case "$1" in
stop)
if [[ $HWCLOCK_PARAMS ]]; then
stat_busy "Saving System Clock"
- /sbin/hwclock --systohc $HWCLOCK_PARAMS || stat_die
+ hwclock --systohc $HWCLOCK_PARAMS || stat_die
stat_done
fi
rm_daemon hwclock
diff --git a/network b/network
index 7350149..b8c900d 100755
--- a/network
+++ b/network
@@ -23,7 +23,7 @@ deprecated() {
}
network_up() {
- /usr/sbin/ip link set dev $interface up || return 1
+ ip link set dev $interface up || return 1
if [[ $address ]]; then
for var in netmask gateway; do
@@ -32,22 +32,22 @@ network_up() {
return 1
fi
done
- /usr/sbin/ip addr add $address/$netmask dev $interface || return 1
- /usr/sbin/ip route add default via $gateway || return 1
+ ip addr add $address/$netmask dev $interface || return 1
+ ip route add default via $gateway || return 1
else
- /sbin/dhcpcd $DHCPCD_ARGS $interface || return 1
+ dhcpcd $DHCPCD_ARGS $interface || return 1
fi
}
network_down() {
if [[ -f /var/run/dhcpcd-$interface.pid ]]; then
- /sbin/dhcpcd -k $interface || return 1
+ dhcpcd -k $interface || return 1
else
- /usr/sbin/ip route del default || return 1
- /usr/sbin/ip addr flush dev $interface || return 1
+ ip route del default || return 1
+ ip addr flush dev $interface || return 1
fi
- /usr/sbin/ip link set dev $interface down || return 1
+ ip link set dev $interface down || return 1
}
ifup() {
@@ -65,17 +65,17 @@ ifup() {
ifname=${ifcfg%% *}
fi
- /sbin/ifconfig $ifname up
+ ifconfig $ifname up
wi_up $1 || return 1
if [[ $ifcfg = dhcp ]]; then
# remove the .pid file if it exists
- /bin/rm -f /var/run/dhcpcd-${1}.pid >/dev/null 2>&1
- /bin/rm -f /var/run/dhcpcd-${1}.cache >/dev/null 2>&1
- /sbin/dhcpcd $DHCPCD_ARGS ${1}
+ rm -f /var/run/dhcpcd-${1}.pid >/dev/null 2>&1
+ rm -f /var/run/dhcpcd-${1}.cache >/dev/null 2>&1
+ dhcpcd $DHCPCD_ARGS ${1}
else
- /sbin/ifconfig $ifcfg
+ ifconfig $ifcfg
fi
}
@@ -84,7 +84,7 @@ wi_up() {
[[ ${!iwcfg} ]] || return 0
- /usr/sbin/iwconfig ${!iwcfg}
+ iwconfig ${!iwcfg}
[[ $WIRELESS_TIMEOUT ]] || WIRELESS_TIMEOUT=2
sleep $WIRELESS_TIMEOUT
@@ -105,10 +105,10 @@ ifdown() {
fi
if [[ $ifcfg = dhcp && -f /var/run/dhcpcd-${1}.pid ]]; then
- /sbin/dhcpcd -k ${1} >/dev/null 2>&1
+ dhcpcd -k ${1} >/dev/null 2>&1
fi
# Always bring the interface itself down
- /sbin/ifconfig ${1} down >/dev/null 2>&1
+ ifconfig ${1} down >/dev/null 2>&1
}
iflist() {
@@ -131,9 +131,9 @@ rtup() {
fi
if [[ $routecfg =~ :: ]]; then
- /sbin/route -A inet6 add $routecfg
+ route -A inet6 add $routecfg
else
- /sbin/route add $routecfg
+ route add $routecfg
fi
}
@@ -146,9 +146,9 @@ rtdown() {
fi
if [[ $routecfg =~ :: ]]; then
- /sbin/route -A inet6 del $routecfg
+ route -A inet6 del $routecfg
else
- /sbin/route del $routecfg
+ route del $routecfg
fi
}
@@ -168,7 +168,7 @@ bond_up() {
if [[ $ifline = ${ifline#!} ]]; then
bondcfg="bond_$ifline"
if [[ ${!bondcfg} ]]; then
- /sbin/ifenslave $ifline ${!bondcfg} || error=1
+ ifenslave $ifline ${!bondcfg} || error=1
fi
fi
done
@@ -178,7 +178,7 @@ bond_down() {
for ifline in ${BOND_INTERFACES[@]}; do
if [[ $ifline = ${ifline#!} ]]; then
bondcfg="bond_$ifline"
- /sbin/ifenslave -d $ifline ${!bondcfg} || error=1
+ ifenslave -d $ifline ${!bondcfg} || error=1
fi
done
}
@@ -187,11 +187,11 @@ bridge_up() {
for br in ${BRIDGE_INTERFACES[@]}; do
if [[ $br = ${br#!} ]]; then
# if the bridge already exists, remove it
- if [[ $(/sbin/ifconfig $br 2>/dev/null) ]]; then
- /sbin/ifconfig $br down
- /usr/sbin/brctl delbr $br
+ if [[ $(ifconfig $br 2>/dev/null) ]]; then
+ ifconfig $br down
+ brctl delbr $br
fi
- /usr/sbin/brctl addbr $br
+ brctl addbr $br
brifs="bridge_$br"
for brif in ${!brifs}; do
if [[ $brif = ${brif#!} ]]; then
@@ -199,12 +199,12 @@ bridge_up() {
if [[ $brif = $ifline && $ifline = ${ifline#!} ]]; then
ifup $ifline
bondcfg="bond_$ifline"
- /sbin/ifenslave $ifline ${!bondcfg} || error=1
+ ifenslave $ifline ${!bondcfg} || error=1
unset bond_$ifline
fi
done
- /usr/sbin/brctl addif $br $brif || error=1
+ brctl addif $br $brif || error=1
fi
done
fi
@@ -214,7 +214,7 @@ bridge_up() {
bridge_down() {
for br in ${BRIDGE_INTERFACES[@]}; do
if [[ $br = ${br#!} ]]; then
- /usr/sbin/brctl delbr $br
+ brctl delbr $br
fi
done
}
@@ -294,7 +294,7 @@ case "$1" in
;;
restart)
$0 stop
- /bin/sleep 2
+ sleep 2
$0 start
;;
ifup|ifdown|iflist|rtup|rtdown|rtlist)
diff --git a/rc.d b/rc.d
index f0c5204..ad0a1e9 100755
--- a/rc.d
+++ b/rc.d
@@ -56,7 +56,7 @@ case $1 in
cd /
for i; do
if [[ -x "/etc/rc.d/$i" ]]; then
- /usr/bin/env -i "${ENV[@]}" "/etc/rc.d/$i" "$action"
+ env -i "${ENV[@]}" "/etc/rc.d/$i" "$action"
else
printf "${C_OTHER}:: ${C_FAIL}Error: ${C_DONE}Daemon script $i does not exist.\n"
fi