Server IP : 103.119.228.120 / Your IP : 3.141.198.147 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 : /lib/dracut/modules.d/40network/ |
Upload File : |
#!/bin/sh # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh # # Format: # ip=[dhcp|on|any] # # ip=<interface>:[dhcp|on|any][:[<mtu>][:<macaddr>]] # # ip=<client-IP-number>:<server-IP-number>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:{dhcp|on|any|none|off}[:[<mtu>][:<macaddr>]] # # When supplying more than only ip= line, <interface> is mandatory and # bootdev= must contain the name of the primary interface to use for # routing,dns,dhcp-options,etc. # command -v getarg >/dev/null || . /lib/dracut-lib.sh if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] && [ -z "$(getarg BOOTIF=)" ]; then # No ip= argument(s) for netroot provided, defaulting to DHCP return; fi # Count ip= lines to decide whether we need bootdev= or not if [ -z "$NEEDBOOTDEV" ] ; then count=0 for p in $(getargs ip=); do case "$p" in ibft) continue;; esac count=$(( $count + 1 )) done [ $count -gt 1 ] && NEEDBOOTDEV=1 fi unset count # If needed, check if bootdev= contains anything usable BOOTDEV=$(getarg bootdev=) if [ -n "$NEEDBOOTDEV" ] && ! getargbool 0 rd.neednet; then #[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines" echo "rd.neednet=1" > /etc/cmdline.d/dracut-neednet.conf info "Multiple ip= arguments: assuming rd.neednet=1" else unset NEEDBOOTDEV fi # Check ip= lines # XXX Would be nice if we could errorcheck ip addresses here as well for p in $(getargs ip=); do ip_to_var $p # make first device specified the BOOTDEV if [ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then BOOTDEV="$dev" info "Setting bootdev to '$BOOTDEV'" fi # skip ibft since we did it above [ "$autoconf" = "ibft" ] && continue # Empty autoconf defaults to 'dhcp' if [ -z "$autoconf" ] ; then warn "Empty autoconf values default to dhcp" autoconf="dhcp" fi # Error checking for autoconf in combination with other values for autoopt in $(str_replace "$autoconf" "," " "); do case $autoopt in error) die "Error parsing option 'ip=$p'";; bootp|rarp|both) die "Sorry, ip=$autoopt is currenty unsupported";; none|off) [ -z "$ip" ] && \ die "For argument 'ip=$p'\nValue '$autoopt' without static configuration does not make sense" [ -z "$mask" ] && \ die "Sorry, automatic calculation of netmask is not yet supported" ;; auto6);; either6);; dhcp|dhcp6|on|any) \ #[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ # die "Sorry, 'ip=$p' does not make sense for multiple interface configurations" [ -n "$ip" ] && \ die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoopt'" ;; *) die "For argument 'ip=$p'\nSorry, unknown value '$autoopt'";; esac done if [ -n "$dev" ] ; then # We don't like duplicate device configs if [ -n "$IFACES" ] ; then for i in $IFACES ; do [ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'" done fi # IFACES list for later use IFACES="$IFACES $dev" fi # Do we need to check for specific options? if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then # Correct device? (Empty is ok as well) [ "$dev" = "$BOOTDEV" ] || continue # Server-ip is there? [ -n "$DHCPORSERVER" ] && [ -n "$srv" ] && continue # dhcp? (It's simpler to check for a set ip. Checks above ensure that if # ip is there, we're static [ -z "$ip" ] && continue # Not good! die "Server-ip or dhcp for netboot needed, but current arguments say otherwise" fi if str_starts "$dev" "enx" && [ ${#dev} -eq 15 ]; then printf -- "ifname=%s:%s:%s:%s:%s:%s:%s\n" \ "$dev" \ "${dev:3:2}" \ "${dev:5:2}" \ "${dev:7:2}" \ "${dev:9:2}" \ "${dev:11:2}" \ "${dev:13:2}" >> /etc/cmdline.d/80-enx.conf fi done # put BOOTIF in IFACES to make sure it comes up if getargbool 1 "rd.bootif" && BOOTIF="$(getarg BOOTIF=)"; then BOOTDEV=$(fix_bootif $BOOTIF) IFACES="$BOOTDEV $IFACES" fi # This ensures that BOOTDEV is always first in IFACES if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}" IFACES="$BOOTDEV $IFACES" fi # Store BOOTDEV and IFACES for later use [ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev [ -n "$IFACES" ] && echo $IFACES > /tmp/net.ifaces