[package] fix sslh init and config files (#5517)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@16851 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
0f1c172996
commit
1cb0bcb88c
@ -1,27 +1,7 @@
|
||||
package 'sslh'
|
||||
|
||||
config 'sslh' 'default'
|
||||
# disable or enable
|
||||
option 'enable' '1'
|
||||
# listen defaults to '0.0.0.0:443' (all interfaces)
|
||||
# -p <listenaddr>:<listenport>
|
||||
option 'listen' ''
|
||||
# ssh defaults to 'localhost:22'
|
||||
# -s <sshhost>:<sshport>
|
||||
option 'ssh' ''
|
||||
# ssl defaults to 'localhost:442'
|
||||
# -l <sslhost>:<sslport>
|
||||
option 'ssl' ''
|
||||
# timeout (for ssh, then ssl is assumed) defaults to 2
|
||||
# -t
|
||||
option 'timeout' ''
|
||||
# verbose defaults to off
|
||||
# -v
|
||||
option 'verbose' '0'
|
||||
package 'sslh'
|
||||
|
||||
config 'sslh' 'default'
|
||||
# disable or enable start of sslh
|
||||
# disable or enable
|
||||
option 'enable' '1'
|
||||
# listen defaults to '0.0.0.0:443' (all interfaces)
|
||||
# -p <listenaddr>:<listenport>
|
||||
@ -32,9 +12,6 @@ config 'sslh' 'default'
|
||||
# ssl defaults to 'localhost:442'
|
||||
# -l <sslhost>:<sslport>
|
||||
option 'ssl' ''
|
||||
# pid file defaults to /var/run/sslh.pid
|
||||
# -P pidfile
|
||||
option 'pidfile' ''
|
||||
# timeout (for ssh, then ssl is assumed) defaults to 2
|
||||
# -t
|
||||
option 'timeout' ''
|
||||
|
@ -79,51 +79,3 @@ stop()
|
||||
done
|
||||
fi
|
||||
}
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2009 OpenWrt.org
|
||||
|
||||
NAME="$(basename "${initscript}")"
|
||||
PROG=/usr/sbin/${NAME}
|
||||
START=95
|
||||
|
||||
start()
|
||||
{
|
||||
# load config into variables
|
||||
uci_load "${NAME}"
|
||||
|
||||
# check if enabled
|
||||
local enabled
|
||||
config_get_bool enabled 'default' 'enable' 0
|
||||
if [ ${enabled} -eq 0 ]
|
||||
then
|
||||
echo "${NAME} is not enabled"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# prepare parameters
|
||||
local ARGS=''
|
||||
# A) listen parameter
|
||||
[ ! -z ${CONFIG_default_listen} ] && ARGS="${ARGS} -p ${CONFIG_default_listen}"
|
||||
# B) ssh parameter
|
||||
[ ! -z ${CONFIG_default_ssh} ] && ARGS="${ARGS} -s ${CONFIG_default_ssh}"
|
||||
# C) ssl parameter
|
||||
[ ! -z ${CONFIG_default_ssl} ] && ARGS="${ARGS} -l ${CONFIG_default_ssl}"
|
||||
# D) pid file
|
||||
[ ! -z ${CONFIG_default_pidfile} ] && ARGS="${ARGS} -P ${CONFIG_default_pidfile}"
|
||||
# E) timeout (for ssh, then ssl is assumed)
|
||||
[ ! -z ${CONFIG_default_timeout} ] && ARGS="${ARGS} -t ${CONFIG_default_timeout}"
|
||||
# F) verbose parameter
|
||||
local verbosed
|
||||
config_get_bool verbosed 'default' 'verbose' 0
|
||||
[ ${verbosed} -ne 0 ] && ARGS="${ARGS} -v"
|
||||
|
||||
# execute command and return its exit code
|
||||
[ ${verbosed} -ne 0 ] && echo "Starting ${PROG} ${ARGS}"
|
||||
${PROG} ${ARGS}
|
||||
return $?
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
killall "${NAME}"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user