diff options
| author | David Bachelart <david.bachelart@bbright.com> | 2017-01-26 10:40:36 +0100 |
|---|---|---|
| committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-01-27 21:35:19 +1300 |
| commit | ddbc51b2478c9e62bdc084c7aaac973bb9824eb1 (patch) | |
| tree | a7368f615fc4e2c1e89d604622c87577a8eda423 /package/sslh/S35sslh | |
| parent | f1b2fc9bb34a9d26b5d14f4bbaab5de0b62b0d96 (diff) | |
| download | buildroot-ddbc51b2478c9e62bdc084c7aaac973bb9824eb1.tar.gz buildroot-ddbc51b2478c9e62bdc084c7aaac973bb9824eb1.zip | |
sslh: new package
Signed-off-by: David Bachelart <david.bachelart@bbright.com>
[Thomas:
- fix download location
- remove <pkg>_SOURCE variable, it was the default value
- remove trailing space
- keep only sha256 hash.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/sslh/S35sslh')
| -rw-r--r-- | package/sslh/S35sslh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/package/sslh/S35sslh b/package/sslh/S35sslh new file mode 100644 index 0000000000..4a613f8400 --- /dev/null +++ b/package/sslh/S35sslh @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Starts the SSLH server +# + +# default setup : listen on port 8090 forward ssh traffic to +# localhost:22 and http traffic to localhost:80 +SSLH_ARGS="--listen 0.0.0.0:8090 --ssh 127.0.0.1:22 --http 127.0.0.1:80" + +# Allow a few customizations from a config file (overrides +# default setup) +test -r /etc/default/sslh && . /etc/default/sslh + +start() { + SSLH_ARGS="$SSLH_ARGS --user root" + echo -n "Starting sslh: " + start-stop-daemon -S -q -p /var/run/sslh.pid \ + --exec /usr/sbin/sslh -- $SSLH_ARGS + [ $? = 0 ] && echo "OK" || echo "FAIL" +} + +stop() { + printf "Stopping sslh: " + start-stop-daemon -K -q -p /var/run/sslh.pid + [ $? = 0 ] && echo "OK" || echo "FAIL" +} + +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? |

