Skip to content

Instantly share code, notes, and snippets.

@dan82840
Created October 16, 2018 03:50
Show Gist options
  • Save dan82840/f9927b428861c1a0aa8e0a3a2b83781e to your computer and use it in GitHub Desktop.
Save dan82840/f9927b428861c1a0aa8e0a3a2b83781e to your computer and use it in GitHub Desktop.
Put udhcpc.user to /etc/udhcpc.user
#!/bin/sh
#
echo "$@" >>/tmp/udhcpc.dump
echo "========================" >> /tmp/udhcpc.dump
set >> /tmp/udhcpc.dump
echo "========================" >> /tmp/udhcpc.dump
@dan82840
Copy link
Author

# cat /tmp/udhcpc.dump 
deconfig
========================
CONFIG_APPEND=''
HOME='/'
HOSTNAME='OpenWrt'
IFS=' 
'
INTERFACE='wan'
JSON_CUR='J_V'
JSON_SEQ='0'
JSON_UNSET=' J_V_action J_V_link_up J_V_keep J_V_interface'
J_V_action='0'
J_V_interface='wan'
J_V_keep='0'
J_V_link_up='0'
K_J_V=' action link_up keep interface'
LD_PRELOAD='/lib/libsetlbf.so'
LIST_SEP=' '
LOAD_STATE='1'
N='
'
NETIFD_MAIN_DIR='/lib/netifd'
NO_EXPORT='1'
N_J_V_link_up='link-up'
OPTIND='1'
PATH='/usr/sbin:/usr/bin:/sbin:/bin'
PPID='1296'
PROTO_DNS=''
PROTO_DNS_SEARCH=''
PROTO_INIT='1'
PROTO_IP6ADDR=''
PROTO_IPADDR=''
PROTO_KEEP='0'
PROTO_NESTED_OPEN=''
PROTO_PREFIX6=''
PROTO_ROUTE=''
PROTO_ROUTE6=''
PROTO_TUNNEL_OPEN=''
PS1='\w \$ '
PS2='> '
PS4='+ '
PWD='/lib/netifd/proto'
SHLVL='2'
TERM='linux'
T_J_V_action='int'
T_J_V_interface='string'
T_J_V_keep='boolean'
T_J_V_link_up='boolean'
_C='0'
interface='eth0'
========================
bound
========================
CONFIG_APPEND=''
HOME='/'
HOSTNAME='OpenWrt'
IFS=' 
'
INTERFACE='wan'
JSON_CUR='J_V'
JSON_SEQ='8'
JSON_UNSET=' J_V_action J_V_link_up J_T1 J_V_data J_T1_leasetime J_V_keep J_A2 J_V_ipaddr J_T3 J_A2_1 J_T3_ipaddr J_T3_mask J_A4 J_V_routes J_T5 J_A4_1 J_T5_target J_T5_netmask J_T5_source J_T6 J_A4_2 J_T6_target J_T6_netmask J_T6_gateway J_T6_source J_A7 J_V_dns J_A7_1 J_A8 J_V_dns_search J_A8_1 J_V_interface'
J_A2_1='J_T3'
J_A4_1='J_T5'
J_A4_2='J_T6'
J_A7_1='192.168.100.1'
J_A8_1='gemtek.com.tw'
J_T1_leasetime='86400'
J_T3_ipaddr='192.168.100.14'
J_T3_mask='255.255.255.0'
J_T5_netmask='32'
J_T5_source='192.168.100.14'
J_T5_target='192.168.100.1'
J_T6_gateway='192.168.100.1'
J_T6_netmask='0'
J_T6_source='192.168.100.14'
J_T6_target='0.0.0.0'
J_V_action='0'
J_V_data='J_T1'
J_V_dns='J_A7'
J_V_dns_search='J_A8'
J_V_interface='wan'
J_V_ipaddr='J_A2'
J_V_keep='0'
J_V_link_up='1'
J_V_routes='J_A4'
K_J_A2=' 1'
K_J_A4=' 1 2'
K_J_A7=' 1'
K_J_A8=' 1'
K_J_T1=' leasetime'
K_J_T3=' ipaddr mask'
K_J_T5=' target netmask source'
K_J_T6=' target netmask gateway source'
K_J_V=' action link_up data keep ipaddr routes dns dns_search interface'
LD_PRELOAD='/lib/libsetlbf.so'
LIST_SEP=' '
LOAD_STATE='1'
N='
'
NETIFD_MAIN_DIR='/lib/netifd'
NO_EXPORT='1'
N_J_V_link_up='link-up'
OPTIND='1'
PATH='/usr/sbin:/usr/bin:/sbin:/bin'
PPID='1296'
PROTO_DNS='192.168.100.1'
PROTO_DNS_SEARCH='gemtek.com.tw'
PROTO_INIT='1'
PROTO_IP6ADDR=''
PROTO_IPADDR='192.168.100.14/255.255.255.0//'
PROTO_KEEP='0'
PROTO_NESTED_OPEN=''
PROTO_PREFIX6=''
PROTO_ROUTE='192.168.100.1/32/////192.168.100.14 0.0.0.0/0/192.168.100.1////192.168.100.14'
PROTO_ROUTE6=''
PROTO_TUNNEL_OPEN=''
PS1='\w \$ '
PS2='> '
PS4='+ '
PWD='/lib/netifd/proto'
SHLVL='2'
S_J_A2='1'
S_J_A4='2'
S_J_A7='1'
S_J_A8='1'
TERM='linux'
T_J_A2_1='object'
T_J_A4_1='object'
T_J_A4_2='object'
T_J_A7_1='string'
T_J_A8_1='string'
T_J_T1_leasetime='int'
T_J_T3_ipaddr='string'
T_J_T3_mask='string'
T_J_T5_netmask='string'
T_J_T5_source='string'
T_J_T5_target='string'
T_J_T6_gateway='string'
T_J_T6_netmask='string'
T_J_T6_source='string'
T_J_T6_target='string'
T_J_V_action='int'
T_J_V_data='object'
T_J_V_dns='array'
T_J_V_dns_search='array'
T_J_V_interface='string'
T_J_V_ipaddr='array'
T_J_V_keep='boolean'
T_J_V_link_up='boolean'
T_J_V_routes='array'
U_J_A2='J_V'
U_J_A4='J_V'
U_J_A7='J_V'
U_J_A8='J_V'
U_J_T1='J_V'
U_J_T3='J_A2'
U_J_T5='J_A4'
U_J_T6='J_A4'
_C='0'
dns='192.168.100.1'
domain='gemtek.com.tw'
i='192.168.100.1'
interface='eth0'
ip='192.168.100.14'
item='gemtek.com.tw'
lease='86400'
mask='24'
opt53='05'
opt58='0000a8c0'
router='192.168.100.1'
serverid='192.168.100.1'
subnet='255.255.255.0'
========================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment