This commit is contained in:
tuend-work
2025-11-12 23:11:18 +07:00
parent 2e16431888
commit 525acd79e4
952 changed files with 0 additions and 57002 deletions

View File

@@ -1,55 +0,0 @@
#!/bin/bash
# chkconfig: 2345 11 50
# description: Load ip's into the network device
### BEGIN INIT INFO
# Provides: startips
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: startips
# Description: script to load in fresh IPs
### END INIT INFO
case "$1" in
stop)
exit 0
;;
esac
DACONF=/usr/local/directadmin/conf/directadmin.conf
IPPATH="/usr/local/directadmin/data/admin/"
IPDIR="ips/"
IPLIST="ip.list"
ADDIP=`grep -m1 '^addip=' ${DACONF} | cut -d= -f2`
OS=`uname`
if [ "${OS}" = "FreeBSD" ]; then
ETH_DEV=`grep -m1 '^ifconfig_' /etc/rc.conf | cut -d= -f1 | cut -d_ -f2`
else
ETH_DEV=eth0
fi
if grep -m1 -q '^ethernet_dev=' ${DACONF}; then
ETH_DEV=`grep -m1 '^ethernet_dev=' ${DACONF} | cut -d= -f2 | cut -d: -f1`
fi
for i in `cat ${IPPATH}${IPLIST}`; do
{
NETMASK=`grep -m1 '^netmask=' ${IPPATH}${IPDIR}${i} | cut -d= -f2`
if [ -z ${NETMASK} ]; then
if echo ${i} | grep -m1 -q ':'; then
NETMASK="/64"
else
NETMASK=255.255.255.0
fi
fi
$ADDIP $i $NETMASK $ETH_DEV >/dev/null
};
done
echo "action=named&value=restart" >> /usr/local/directadmin/data/task.queue
exit 0