Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../.././lib/svc/method/net-dhcp-client
Real path: /lib/svc/method/net-dhcp-client
Zurück
#!/usr/sbin/sh # # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # . /lib/svc/share/net_include.sh . /lib/svc/share/smf_include.sh if [ -z "$SMF_FMRI" ]; then echo "this script can only be invoked by smf(5)" exit $SMF_EXIT_ERR_NOSMF fi # # Use netbootinfo to determine whether dhcpagent should adopt interface. # Return 0 if the IPv4 interface should be adopted. # check_netinstall () { # # netbootinfo returns an error in the non-network boot # case. So, just return. # strategy=`$NETBOOTINFO net-config-strategy 2>/dev/null` if [ "$strategy" = "dhcp" ]; then # # Check if vlan specified, If so, don't adopt as # network/physical instead initializes a VLAN VNIC for # the install to use # vlan=`$NETBOOTINFO vlan 2>/dev/null` if [ "$vlan" = "none" ]; then echo 0 else echo 1 fi else echo 1 fi } # # Use netbootinfo to determine the netbooted interface and see if the lease # file for this interface already exists. If so, it means that the interface # has already been adopted. # check_adopted () { intf=`$NETBOOTINFO interface-name 2>/dev/null` [ $? -ne 0 -o -z "$intf" -o "$intf" = "none" ] && echo 1 if [ -e "/var/dhcp/${intf}.dhc" ]; then echo 1 else echo 0 fi } case "$1" in 'start') # # No need to start the daemon in a shared stack zone; disable the # service instead # smf_configure_ip if [ $? -eq 1 ]; then smf_method_exit $SMF_EXIT_TEMP_DISABLE shared_stack \ "$SMF_FMRI does not run in a shared-stack zone" fi # # Determine if dhcpagent should run with adopt # adopt=1 if smf_is_globalzone; then adopt=`check_netinstall` [ "$adopt" -eq 0 ] && adopt=`check_adopted` fi # start dhcpagent if [ "$adopt" -eq 0 ]; then /usr/sbin/dhcpagent -a || exit $SMF_EXIT_ERR_FATAL echo "Adopted DHCP configured interface" else /usr/sbin/dhcpagent || exit $SMF_EXIT_ERR_FATAL fi ;; esac exit $SMF_EXIT_OK