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>
# 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' ''
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}"
-}