examples: remove /sbin/ prefixes, system should be configured with $PATH to find utilities

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2020-12-13 21:35:26 +01:00
parent 5d553bc558
commit 1b367cbeda
4 changed files with 10 additions and 10 deletions

View File

@ -6,12 +6,12 @@ RESOLV_CONF="/etc/udhcpc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet" [ -n "$subnet" ] && NETMASK="netmask $subnet"
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] if [ -n "$router" ]
then then
echo "deleting routers" echo "deleting routers"
while /sbin/route del default gw 0.0.0.0 dev $interface while route del default gw 0.0.0.0 dev $interface
do : do :
done done
@ -23,9 +23,9 @@ then
# /32 instructs kernel to always use routing for all outgoing packets # /32 instructs kernel to always use routing for all outgoing packets
# (they can never be sent to local subnet - there is no local subnet for /32). # (they can never be sent to local subnet - there is no local subnet for /32).
# Used in datacenters, avoids the need for private ip-addresses between two hops. # Used in datacenters, avoids the need for private ip-addresses between two hops.
/sbin/ip route add $i dev $interface ip route add $i dev $interface
fi fi
/sbin/route add default gw $i dev $interface metric $((metric++)) route add default gw $i dev $interface metric $((metric++))
done done
fi fi

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
# Sample udhcpc deconfig script # Sample udhcpc deconfig script
/sbin/ifconfig $interface 0.0.0.0 ifconfig $interface 0.0.0.0

View File

@ -6,12 +6,12 @@ RESOLV_CONF="/etc/udhcpc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast" [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet" [ -n "$subnet" ] && NETMASK="netmask $subnet"
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] if [ -n "$router" ]
then then
echo "deleting routers" echo "deleting routers"
while /sbin/route del default gw 0.0.0.0 dev $interface while route del default gw 0.0.0.0 dev $interface
do : do :
done done
@ -23,9 +23,9 @@ then
# /32 instructs kernel to always use routing for all outgoing packets # /32 instructs kernel to always use routing for all outgoing packets
# (they can never be sent to local subnet - there is no local subnet for /32). # (they can never be sent to local subnet - there is no local subnet for /32).
# Used in datacenters, avoids the need for private ip-addresses between two hops. # Used in datacenters, avoids the need for private ip-addresses between two hops.
/sbin/ip route add $i dev $interface ip route add $i dev $interface
fi fi
/sbin/route add default gw $i dev $interface metric $((metric++)) route add default gw $i dev $interface metric $((metric++))
done done
fi fi