automatic commit - 30-12-2022
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
#!/c/mint/sys/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
#if [ -x /usr/bin/logger ]; then
|
||||
# LOGGER="/usr/bin/logger -s -p user.notice -t dhclient"
|
||||
#else
|
||||
LOGGER=/c/mint/sys/bin/echo.ttp
|
||||
LOGGER=/bin/echo
|
||||
#fi
|
||||
|
||||
make_resolv_conf() {
|
||||
if [ "x$new_domain_name" != x ] || [ x"$new_domain_name_servers" != x ]; then
|
||||
>/etc/resolv.conf
|
||||
if [ "x$new_domain_name" != x ]; then
|
||||
/c/mint/sys/bin/echo.ttp search $new_domain_name >/etc/resolv.conf
|
||||
$LOGGER search $new_domain_name >/etc/resolv.conf
|
||||
fi
|
||||
if [ "x$new_domain_name_servers" != x ]; then
|
||||
for nameserver in $new_domain_name_servers; do
|
||||
/c/mint/sys/bin/echo.ttp nameserver $nameserver >>/etc/resolv.conf
|
||||
$LOGGER nameserver $nameserver >>/etc/resolv.conf
|
||||
done
|
||||
fi
|
||||
fi
|
||||
@@ -63,18 +63,18 @@ if [ x$alias_subnet_mask != x ]; then
|
||||
fi
|
||||
|
||||
if [ x$reason = xMEDIUM ]; then
|
||||
eval "/c/mint/sys/net/ifconfig.ttp $interface $medium"
|
||||
eval "/c/mint/sys/net/ifconfig.ttp $interface addr -alias 0.0.0.0 $medium" >/dev/null 2>&1
|
||||
eval "/bin/ifconfig $interface $medium"
|
||||
eval "/bin/ifconfig $interface addr -alias 0.0.0.0 $medium" >/dev/null 2>&1
|
||||
sleep 1
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xPREINIT ]; then
|
||||
if [ x$alias_ip_address != x ]; then
|
||||
/c/mint/sys/net/ifconfig.ttp $interface addr -alias $alias_ip_address > /dev/null 2>&1
|
||||
/c/mint/sys/net/route.ttp delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
|
||||
/bin/ifconfig $interface addr -alias $alias_ip_address > /dev/null 2>&1
|
||||
/bin/route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
|
||||
fi
|
||||
/c/mint/sys/net/ifconfig.ttp $interface addr 0.0.0.0 netmask 0.0.0.0 \
|
||||
/bin/ifconfig $interface addr 0.0.0.0 netmask 0.0.0.0 \
|
||||
broadaddr 255.255.255.255 up
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
@@ -131,20 +131,20 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
||||
# fi
|
||||
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
|
||||
[ x$alias_ip_address != x$old_ip_address ]; then
|
||||
/c/mint/sys/net/ifconfig.ttp $interface addr -alias $alias_ip_address > /dev/null 2>&1
|
||||
/c/mint/sys/net/route.ttp delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
|
||||
/bin/ifconfig $interface addr -alias $alias_ip_address > /dev/null 2>&1
|
||||
/bin/route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
|
||||
fi
|
||||
if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
|
||||
then
|
||||
eval "/c/mint/sys/net/ifconfig.ttp $interface addr -alias $old_ip_address $medium"
|
||||
/c/mint/sys/net/route.ttp delete $old_ip_address 127.1 >/dev/null 2>&1
|
||||
eval "/bin/ifconfig $interface addr -alias $old_ip_address $medium"
|
||||
/bin/route delete $old_ip_address 127.1 >/dev/null 2>&1
|
||||
for router in $old_routers; do
|
||||
/c/mint/sys/net/route.ttp delete default $router >/dev/null 2>&1
|
||||
/bin/route delete default $router >/dev/null 2>&1
|
||||
done
|
||||
if [ "$old_static_routes" != "" ]; then
|
||||
set -- $old_static_routes
|
||||
while [ $# -gt 1 ]; do
|
||||
/c/mint/sys/net/route.ttp delete $1 $2
|
||||
/bin/route delete $1 $2
|
||||
shift; shift
|
||||
done
|
||||
fi
|
||||
@@ -152,7 +152,7 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
||||
fi
|
||||
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
|
||||
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
|
||||
eval "/c/mint/sys/net/ifconfig.ttp $interface addr $new_ip_address $new_netmask_arg \
|
||||
eval "/bin/ifconfig $interface addr $new_ip_address $new_netmask_arg \
|
||||
$new_broadcast_arg $medium"
|
||||
$LOGGER "New IP Address($interface): $new_ip_address"
|
||||
$LOGGER "New Subnet Mask($interface): $new_subnet_mask"
|
||||
@@ -160,23 +160,23 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
||||
if [ "$new_routers" != "" ]; then
|
||||
$LOGGER "New Routers: $new_routers"
|
||||
fi
|
||||
/c/mint/sys/net/route.ttp add $new_ip_address 127.1 >/dev/null 2>&1
|
||||
/bin/route add $new_ip_address 127.1 >/dev/null 2>&1
|
||||
for router in $new_routers; do
|
||||
/c/mint/sys/net/route.ttp add default $interface gw $router >/dev/null 2>&1
|
||||
/bin/route add default $interface gw $router >/dev/null 2>&1
|
||||
done
|
||||
if [ "$new_static_routes" != "" ]; then
|
||||
$LOGGER "New Static Routes: $new_static_routes"
|
||||
set -- $new_static_routes
|
||||
while [ $# -gt 1 ]; do
|
||||
/c/mint/sys/net/route.ttp add $1 $2
|
||||
/bin/route add $1 $2
|
||||
shift; shift
|
||||
done
|
||||
fi
|
||||
fi
|
||||
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
|
||||
then
|
||||
/c/mint/sys/net/ifconfig.ttp $interface addr alias $alias_ip_address $alias_subnet_arg
|
||||
/c/mint/sys/net/route.ttp add $alias_ip_address 127.0.0.1
|
||||
/bin/ifconfig $interface addr alias $alias_ip_address $alias_subnet_arg
|
||||
/bin/route add $alias_ip_address 127.0.0.1
|
||||
fi
|
||||
make_resolv_conf
|
||||
exit_with_hooks 0
|
||||
@@ -185,19 +185,19 @@ fi
|
||||
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
|
||||
|| [ x$reason = xSTOP ]; then
|
||||
if [ x$alias_ip_address != x ]; then
|
||||
/c/mint/sys/net/ifconfig.ttp $interface addr -alias $alias_ip_address > /dev/null 2>&1
|
||||
/c/mint/sys/net/route.ttp delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
|
||||
/bin/ifconfig $interface addr -alias $alias_ip_address > /dev/null 2>&1
|
||||
/bin/route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
|
||||
fi
|
||||
if [ x$old_ip_address != x ]; then
|
||||
eval "/c/mint/sys/net/ifconfig.ttp $interface addr -alias $old_ip_address $medium"
|
||||
/c/mint/sys/net/route.ttp delete $old_ip_address 127.1 >/dev/null 2>&1
|
||||
eval "/bin/ifconfig $interface addr -alias $old_ip_address $medium"
|
||||
/bin/route delete $old_ip_address 127.1 >/dev/null 2>&1
|
||||
for router in $old_routers; do
|
||||
/c/mint/sys/net/route.ttp delete default $router >/dev/null 2>&1
|
||||
/bin/route delete default $router >/dev/null 2>&1
|
||||
done
|
||||
if [ "$old_static_routes" != "" ]; then
|
||||
set -- $old_static_routes
|
||||
while [ $# -gt 1 ]; do
|
||||
/c/mint/sys/net/route.ttp delete $1 $2
|
||||
/bin/route delete $1 $2
|
||||
shift; shift
|
||||
done
|
||||
fi
|
||||
@@ -205,18 +205,18 @@ if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
|
||||
|sh >/dev/null 2>&1
|
||||
fi
|
||||
if [ x$alias_ip_address != x ]; then
|
||||
/c/mint/sys/net/ifconfig.ttp $interface addr alias $alias_ip_address $alias_subnet_arg
|
||||
/c/mint/sys/net/route.ttp add $alias_ip_address 127.0.0.1
|
||||
/bin/ifconfig $interface addr alias $alias_ip_address $alias_subnet_arg
|
||||
/bin/route add $alias_ip_address 127.0.0.1
|
||||
fi
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
|
||||
if [ x$reason = xTIMEOUT ]; then
|
||||
if [ x$alias_ip_address != x ]; then
|
||||
/c/mint/sys/net/ifconfig.ttp $interface addr -alias $alias_ip_address > /dev/null 2>&1
|
||||
/c/mint/sys/net/route.ttp delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
|
||||
/bin/ifconfig $interface addr -alias $alias_ip_address > /dev/null 2>&1
|
||||
/bin/route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
|
||||
fi
|
||||
eval "/c/mint/sys/net/ifconfig.ttp $interface addr $new_ip_address $new_netmask_arg \
|
||||
eval "/bin/ifconfig $interface addr $new_ip_address $new_netmask_arg \
|
||||
$new_broadcast_arg $medium"
|
||||
$LOGGER "New IP Address($interface): $new_ip_address"
|
||||
$LOGGER "New Subnet Mask($interface): $new_subnet_mask"
|
||||
@@ -228,30 +228,30 @@ if [ x$reason = xTIMEOUT ]; then
|
||||
if ping -q -c 1 $1; then
|
||||
if [ x$new_ip_address != x$alias_ip_address ] && \
|
||||
[ x$alias_ip_address != x ]; then
|
||||
/c/mint/sys/net/ifconfig.ttp $interface addr alias $alias_ip_address $alias_subnet_arg
|
||||
/c/mint/sys/net/route.ttp add $alias_ip_address 127.0.0.1
|
||||
/bin/ifconfig $interface addr alias $alias_ip_address $alias_subnet_arg
|
||||
/bin/route add $alias_ip_address 127.0.0.1
|
||||
fi
|
||||
/c/mint/sys/net/route.ttp add $new_ip_address 127.1 >/dev/null 2>&1
|
||||
/bin/route add $new_ip_address 127.1 >/dev/null 2>&1
|
||||
for router in $new_routers; do
|
||||
/c/mint/sys/net/route.ttp add default $interface gw $router >/dev/null 2>&1
|
||||
/bin/route add default $interface gw $router >/dev/null 2>&1
|
||||
done
|
||||
set -- $new_static_routes
|
||||
while [ $# -gt 1 ]; do
|
||||
/c/mint/sys/net/route.ttp add $1 $2
|
||||
/bin/route add $1 $2
|
||||
shift; shift
|
||||
done
|
||||
make_resolv_conf
|
||||
exit_with_hooks 0
|
||||
fi
|
||||
fi
|
||||
eval "/c/mint/sys/net/ifconfig.ttp $interface addr -alias $new_ip_address $medium"
|
||||
eval "/bin/ifconfig $interface addr -alias $new_ip_address $medium"
|
||||
for router in $old_routers; do
|
||||
/c/mint/sys/net/route.ttp delete default $router >/dev/null 2>&1
|
||||
/bin/route delete default $router >/dev/null 2>&1
|
||||
done
|
||||
if [ "$old_static_routes" != "" ]; then
|
||||
set -- $old_static_routes
|
||||
while [ $# -gt 1 ]; do
|
||||
/c/mint/sys/net/route.ttp delete $1 $2
|
||||
/bin/route delete $1 $2
|
||||
shift; shift
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user