1 #!/bin/sh /etc/rc.common
3 .
/lib
/functions
/network.sh
12 local interface ifname id description
host port ssl
14 uci_validate_section rtty rtty
"${1}" \
15 'interface:uci("network", "@interface"):lan' \
17 'description:maxlength(126)' \
21 'keepalive:uinteger:5'
24 echo "validation failed" >&2
28 [ -n "$interface" ] && network_get_device ifname
"$interface"
30 [ -z "$ifname" -a -z "$id" ] && {
31 echo "You must specify an interface or ID" >&2
36 echo "host required" >&2
41 echo "port required" >&2
46 procd_set_param
command $BIN -h $host -p $port -a -k $keepalive
47 [ -n "$ifname" ] && procd_append_param
command -i "$ifname"
48 [ -n "$id" ] && procd_append_param
command -I "$id"
49 [ -n "$description" ] && procd_append_param
command -d "$description"
50 [ "$ssl" = "1" ] && procd_append_param
command -s
51 procd_set_param respawn
57 config_foreach start_rtty rtty