summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-09-10 22:19:38 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-09-10 22:19:38 +0000
commitf968bb86fd0bafaab33a68d571e07a17b7846fb2 (patch)
treef41896b9c4ea893af7b4ad74f8aa741c4b953eb2 /sbin
parent4c808788584d64fd220a17c60da19c68b6d8ab37 (diff)
downloadpfsense-f968bb86fd0bafaab33a68d571e07a17b7846fb2.zip
pfsense-f968bb86fd0bafaab33a68d571e07a17b7846fb2.tar.gz
use full path to route
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/dhclient-script21
1 files changed, 10 insertions, 11 deletions
diff --git a/sbin/dhclient-script b/sbin/dhclient-script
index e3af913..8d40ea8 100755
--- a/sbin/dhclient-script
+++ b/sbin/dhclient-script
@@ -17,13 +17,12 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-#
NETSTAT=/usr/bin/netstat
GREP=/usr/bin/grep
AWK=/usr/bin/awk
HOSTNAME=/bin/hostname
-
+ROUTE=/sbin/route
LOCALHOST=127.0.0.1
if [ -x /usr/bin/logger ]; then
@@ -77,7 +76,7 @@ add_new_address() {
delete_old_alias() {
if [ -n "$alias_ip_address" ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
- route delete $alias_ip_address $LOCALHOST > /dev/null 2>&1
+ $ROUTE delete $alias_ip_address $LOCALHOST > /dev/null 2>&1
fi
}
@@ -85,15 +84,15 @@ add_new_alias() {
if [ -n "$alias_ip_address" ]; then
ifconfig $interface inet alias $alias_ip_address netmask \
$alias_subnet_mask
- route add $alias_ip_address $LOCALHOST
+ $ROUTE add $alias_ip_address $LOCALHOST
fi
}
delete_old_routes() {
- route delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1
+ $ROUTE delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1
for router in $old_routers; do
if [ $if_defaultroute = x -o $if_defaultroute = $interface ]; then
- route delete default $route >/dev/null 2>&1
+ $ROUTE delete default $route >/dev/null 2>&1
rm -f /tmp/${interface}_router
fi
done
@@ -101,7 +100,7 @@ delete_old_routes() {
if [ -n "$old_static_routes" ]; then
set $old_static_routes
while [ $# -gt 1 ]; do
- route delete "$1" "$2"
+ $ROUTE delete "$1" "$2"
shift; shift
rm -f /tmp/${interface}_router
done
@@ -111,12 +110,12 @@ delete_old_routes() {
}
add_new_routes() {
- route add $new_ip_address $LOCALHOST >/dev/null 2>&1
+ $ROUTE add $new_ip_address $LOCALHOST >/dev/null 2>&1
for router in $new_routers; do
if [ "$new_ip_address" = "$router" ]; then
- route add default -iface $router >/dev/null 2>&1
+ $ROUTE add default -iface $router >/dev/null 2>&1
else
- route add default $router >/dev/null 2>&1
+ $ROUTE add default $router >/dev/null 2>&1
echo $new_routers > /tmp/${interface}_router
fi
# 2nd and subsequent default routers error out, so explicitly
@@ -128,7 +127,7 @@ add_new_routes() {
$LOGGER "New Static Routes ($interface): $new_static_routes"
set $new_static_routes
while [ $# -gt 1 ]; do
- route add $1 $2
+ $ROUTE add $1 $2
shift; shift
echo $new_routers > /tmp/${interface}_router
done
OpenPOWER on IntegriCloud