403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.57
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/initramfs-tools/dhcpcd-hooks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/initramfs-tools/dhcpcd-hooks/70-net-conf
#!/bin/sh
set -e

# dhcpcd client hook to write /run/net*.conf files compatible to ipconfig from klibc-utils

# Ensure that the search domain ends with dots
domain_search_with_trailing_dots() {
	local domain_search=""
	for domain in $1; do
		domain_search="${domain_search}${domain_search:+ }${domain%.}."
	done
	echo "$domain_search"
}

write_dhcp_netinfo() {
	local domain_search netinfo_path="$1"

	domain_search=$(domain_search_with_trailing_dots "${new_domain_search-}")
	cat >"$netinfo_path" << EOF
DEVICE='${interface-}'
PROTO='${protocol-}'
IPV4ADDR='${new_ip_address-}'
IPV4BROADCAST='${new_broadcast_address-}'
IPV4NETMASK='${new_subnet_mask-}'
IPV4GATEWAY='${new_routers-}'
IPV4DNS0='${new_domain_name_servers-}'
HOSTNAME='${new_host_name-}'
DNSDOMAIN='${new_domain_name-}'
ROOTSERVER='${new_routers-}'
filename='${new_filename-}'
DHCPLEASETIME='${new_dhcp_lease_time-}'
DOMAINSEARCH='${domain_search}'
EOF
}

write_dhcp6_netinfo() {
	local domain_search netinfo_path="$1"

	domain_search=$(domain_search_with_trailing_dots "${new_dhcp6_domain_search-}")
	cat >"$netinfo_path" << EOF
DEVICE6='${interface-}'
IPV6PROTO='${protocol-}'
IPV6ADDR='${new_dhcp6_ia_na1_ia_addr1-}'
IPV6NETMASK='128'
IPV6DNS0='${new_dhcp6_name_servers-}'
IPV6DOMAINSEARCH='${domain_search}'
EOF
}

if ${if_configured?}; then
	if ${if_up?}; then
		if [ "${protocol?}" = dhcp ]; then
			write_dhcp_netinfo "/run/net-${interface?}.conf"
		elif [ "${protocol}" = dhcp6 ]; then
			write_dhcp6_netinfo "/run/net6-${interface?}.conf"
		fi
	elif ${if_down?}; then
		if [ "${protocol?}" = dhcp ]; then
			rm -f "/run/net-${interface?}.conf"
		elif [ "${protocol}" = dhcp6 ]; then
			rm -f "/run/net6-${interface?}.conf"
		fi
	fi
fi

Youez - 2016 - github.com/yon3zu
LinuXploit