1 #!/bin/sh /etc/rc.common
3 # XXX - is there something that should cause reload? or can we just
4 # use info from netifd and let it handle dynamic changes? let's hope
11 DNSMASQ_DIR
=/tmp
/dnsmasq.d
12 DNSMASQ_SCRIPT
=/etc
/init.d
/dnsmasq
13 OHP_SCRIPT
=/usr
/sbin
/hnetd-ohp-script
14 OHP_BINARY
=/usr
/sbin
/ohybridproxy
15 PCP_SCRIPT
=/usr
/sbin
/hnetd-pcp-script
16 PCP_BINARY
=/usr
/sbin
/minimalist-pcproxy
17 MULTICAST_SCRIPT
=/usr
/sbin
/hnet-multicast
18 WIFI_SCRIPT
=/usr
/sbin
/autowifi
22 .
/lib
/functions
/network.sh
27 procd_set_param
command /usr
/sbin
/hnetd
29 # SD parts are here (make configurable?)
30 if [ -f $OHP_BINARY -a -f $DNSMASQ_SCRIPT ]
33 procd_append_param
command -d $DNSMASQ_SCRIPT
34 procd_append_param
command -f $DNSMASQ_DIR/hnet.conf
35 procd_append_param
command -o $OHP_SCRIPT
36 HOSTNAME
=`cat /proc/sys/kernel/hostname`
39 procd_append_param
command -n "$HOSTNAME"
43 # Enable multicast if present and installed
44 if [ -f "$MULTICAST_SCRIPT" ]
46 $MULTICAST_SCRIPT status
&& procd_append_param
command -M "$MULTICAST_SCRIPT"
49 config_get enableval wifi
enable
50 if [ -f "$WIFI_SCRIPT" -a "$enableval" = "1" ]; then
52 config_get ssidval wifi ssid
53 config_get passval wifi password
54 if [ -n "$ssidval" -a -n "$passval" ]; then
55 wifiopt
=${wifiopt},${ssidval}:${passval}
57 procd_append_param
command -w "$wifiopt"
60 # Enable PCP, if it's present
61 if [ -f $PCP_BINARY -a -f $PCP_SCRIPT ]
63 procd_append_param
command -c $PCP_SCRIPT
67 config_get val pa persistent_store
68 procd_append_param
command -s ${val:-/tmp/hnetd.pa_state}
71 procd_append_param
command -r /usr
/sbin
/hnetd-routing
73 [ -x /usr
/sbin
/hnetd-tunnel
] && \
74 procd_append_param
command -t /usr
/sbin
/hnetd-tunnel
76 # Prefix assignment (pa)
77 config_get val pa ip4prefix
78 [ -n "$val" ] && procd_append_param
command --ip4prefix $val
80 config_get val pa ulaprefix
81 [ -n "$val" ] && procd_append_param
command --ulaprefix $val
83 config_get val pa ulamode
84 [ -n "$val" ] && procd_append_param
command --ulamode $val
86 # Service discovery (sd)
87 config_get val sd router_name
88 [ -n "$val" ] && procd_append_param
command -n $val
90 config_get val sd domain_name
91 [ -n "$val" ] && procd_append_param
command -m $val
93 # Security (needs security-enabled build)
94 config_get val security password
95 [ -n "$val" ] && procd_append_param
command --password $val
97 config_get val security certificate_file
98 [ -n "$val" ] && procd_append_param
command --certificate $val
100 config_get val security private_key_file
101 [ -n "$val" ] && procd_append_param
command --privatekey $val
103 config_get val security trust_store
104 [ -n "$val" ] && procd_append_param
command --trust $val
106 config_get val security trust_certificate_file
107 [ -n "$val" ] && procd_append_param
command --verify-path $val
109 # For more verbose logging, uncomment this:
110 #procd_append_param command --loglevel 7
112 procd_set_param respawn
117 procd_add_reload_trigger
"hnet"