分类: LINUX
2006-09-12 23:33:14
vmware_start_dhcpd() { local vHostIf="$1" # IN # The daemon already logs its output in the system log, so we can safely # trash it cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$dhcpd" \ -cf "$vmware_etc_dir"/"$vHostIf"/dhcpd/dhcpd.conf \ -lf "$vmware_etc_dir"/"$vHostIf"/dhcpd/dhcpd.leases \ -pf /var/run/"$dhcpd"-"$vHostIf".pid "$vHostIf" >/dev/null 2>&1 } # Stop a DHCP server on a private IP network vmware_stop_dhcpd() { local vHostIf="$1" # IN if vmware_stop_pidfile /var/run/"$dhcpd"-"$vHostIf".pid; then rm -f /var/run/"$dhcpd"-"$vHostIf".pid fi } |
vmware_start_dhcpd() { local vHostIf="$1" # IN # The daemon already logs its output in the system log, so we can safely # trash it # cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$dhcpd" \ # -cf "$vmware_etc_dir"/"$vHostIf"/dhcpd/dhcpd.conf \ # -lf "$vmware_etc_dir"/"$vHostIf"/dhcpd/dhcpd.leases \ # -pf /var/run/"$dhcpd"-"$vHostIf".pid "$vHostIf" >/dev/null 2>&1 } # Stop a DHCP server on a private IP network vmware_stop_dhcpd() { local vHostIf="$1" # IN # if vmware_stop_pidfile /var/run/"$dhcpd"-"$vHostIf".pid; then # rm -f /var/run/"$dhcpd"-"$vHostIf".pid # fi } |
#vDhcpIf define interface on which dhcp run, interfaces are seprated with space vDhcpIf="vmnet1 vmnet2" # Start a DHCP server on a private IP network vmware_start_dhcpd() { local vHostIf="$1" # IN # The daemon already logs its output in the system log, so we can safely # trash it if echo $vDhcpIf|tr ' ' '\n' |grep $vHostIf >/dev/null then cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$dhcpd" \ -cf "$vmware_etc_dir"/"$vHostIf"/dhcpd/dhcpd.conf \ -lf "$vmware_etc_dir"/"$vHostIf"/dhcpd/dhcpd.leases \ -pf /var/run/"$dhcpd"-"$vHostIf".pid "$vHostIf" >/dev/null 2>&1 fi } # Stop a DHCP server on a private IP network vmware_stop_dhcpd() { local vHostIf="$1" # IN if echo $vDhcpIf|tr ' ' '\n' |grep $vHostIf >/dev/null then if vmware_stop_pidfile /var/run/"$dhcpd"-"$vHostIf".pid; then rm -f /var/run/"$dhcpd"-"$vHostIf".pid fi fi } |