rtty: Convert init script indentation from spaces to tabs
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
parent
f9b16dea51
commit
e0266203e8
1 changed files with 40 additions and 41 deletions
|
@ -6,54 +6,53 @@ START=99
|
||||||
BIN=/usr/sbin/rtty
|
BIN=/usr/sbin/rtty
|
||||||
|
|
||||||
start_rtty() {
|
start_rtty() {
|
||||||
. /lib/functions/network.sh
|
. /lib/functions/network.sh
|
||||||
|
|
||||||
local cfg="$1"
|
local cfg="$1"
|
||||||
local interface ifname id description host port ssl
|
local interface ifname id description host port ssl
|
||||||
|
|
||||||
uci_validate_section rtty rtty "${1}" \
|
uci_validate_section rtty rtty "${1}" \
|
||||||
'interface:uci("network", "@interface"):lan' \
|
'interface:uci("network", "@interface"):lan' \
|
||||||
'id:maxlength(63)' \
|
'id:maxlength(63)' \
|
||||||
'description:maxlength(126)' \
|
'description:maxlength(126)' \
|
||||||
'host:host' \
|
'host:host' \
|
||||||
'port:port' \
|
'port:port' \
|
||||||
'ssl:bool:0' \
|
'ssl:bool:0' \
|
||||||
'keepalive:uinteger:5'
|
'keepalive:uinteger:5'
|
||||||
|
|
||||||
[ $? -ne 0 ] && {
|
[ $? -ne 0 ] && {
|
||||||
echo "validation failed" >&2
|
echo "validation failed" >&2
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -n "$interface" ] && network_get_device ifname "$interface"
|
[ -n "$interface" ] && network_get_device ifname "$interface"
|
||||||
|
|
||||||
[ -z "$ifname" -a -z "$id" ] && {
|
[ -z "$ifname" -a -z "$id" ] && {
|
||||||
echo "You must specify an interface or ID" >&2
|
echo "You must specify an interface or ID" >&2
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -z "$host" ] && {
|
[ -z "$host" ] && {
|
||||||
echo "host required" >&2
|
echo "host required" >&2
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -z "$port" ] && {
|
[ -z "$port" ] && {
|
||||||
echo "port required" >&2
|
echo "port required" >&2
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command $BIN -h $host -p $port -a -k $keepalive
|
procd_set_param command $BIN -h $host -p $port -a -k $keepalive
|
||||||
[ -n "$ifname" ] && procd_append_param command -i "$ifname"
|
[ -n "$ifname" ] && procd_append_param command -i "$ifname"
|
||||||
[ -n "$id" ] && procd_append_param command -I "$id"
|
[ -n "$id" ] && procd_append_param command -I "$id"
|
||||||
[ -n "$description" ] && procd_append_param command -d "$description"
|
[ -n "$description" ] && procd_append_param command -d "$description"
|
||||||
[ "$ssl" = "1" ] && procd_append_param command -s
|
[ "$ssl" = "1" ] && procd_append_param command -s
|
||||||
procd_set_param respawn
|
procd_set_param respawn
|
||||||
procd_close_instance
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
config_load rtty
|
config_load rtty
|
||||||
config_foreach start_rtty rtty
|
config_foreach start_rtty rtty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue