1 #!/bin/sh /etc/rc.common
8 validate_rtty_section
() {
9 uci_load_validate rtty rtty
"$1" "$2" \
10 'interface:uci("network", "@interface"):lan' \
12 'description:maxlength(126)' \
17 'token:maxlength(32)' \
23 .
/lib
/functions
/network.sh
28 echo "validation failed" >&2
32 [ -n "$interface" ] && network_get_device ifname
"$interface"
34 [ -z "$ifname" -a -z "$id" ] && {
35 echo "You must specify an interface or ID" >&2
40 echo "host required" >&2
45 id
=$
(sed 's/://g' /sys
/class
/net
/$ifname/address |
tr 'a-z' 'A-Z')
49 procd_set_param
command $BIN -h $host -I "$id" -a
50 [ -n "$port" ] && procd_append_param
command -p "$port"
51 [ -n "$description" ] && procd_append_param
command -d "$description"
52 [ "$ssl" = "1" ] && procd_append_param
command -s
53 [ "$insecure" = "1" ] && procd_append_param
command -x
54 [ -n "$token" ] && procd_append_param
command -t "$token"
55 [ -n "$username" ] && procd_append_param
command -f "$username"
56 [ "$verbose" = "1" ] && procd_append_param
command -v
57 procd_set_param respawn
63 config_foreach validate_rtty_section rtty start_rtty
67 procd_add_reload_trigger
"rtty"
68 procd_add_validation validate_rtty_section