diff --git a/ssh-tunnel-manager.sh b/ssh-tunnel-manager.sh index e9643d5570bbeab5451396e97b32260f4764c452..a6ed2537be206bb2aa45f2c97e5133ef35039164 100755 --- a/ssh-tunnel-manager.sh +++ b/ssh-tunnel-manager.sh @@ -2,7 +2,7 @@ # # @author Gerhard Steinbeis (info [at] tinned-software [dot] net) # @copyright Copyright (c) 2013 -version=0.6.6 +version=0.6.7 # @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 # @package net # @@ -11,25 +11,6 @@ version=0.6.6 # the ssh-tunnel-manager.conf in the same directory as the script itself. # -# ssh-tunnel-manager Start up the ssh-tunnel-manager manager -# -# chkconfig: 2345 60 20 -# description: SSH-Tunnel-Manager to manager multiple SSH connections to different servers. -# -# config: /etc/ssh-tunnel-manager.conf - -### BEGIN INIT INFO -# Provides: ssh-tunnel-manager -# Required-Start: $network sshd -# Required-Stop: $network sshd -# Should-Start: -# Should-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start up the ssh-tunnel-manager manager -# Description: SSH-Tunnel-Manager to manager multiple SSH connections to different servers. -### END INIT INFO - # # Define names for the tunnel to identify them. The list needs to be configured # in the same order as the tunnel config in the TUNELS list. diff --git a/ssh-tunnel-manager.sysv-initscript b/ssh-tunnel-manager.sysv-initscript new file mode 100644 index 0000000000000000000000000000000000000000..ce6d3f9d8b018a6cdd72aae86241c2c8089b82a7 --- /dev/null +++ b/ssh-tunnel-manager.sysv-initscript @@ -0,0 +1,69 @@ +#!/bin/sh +# +# ssh-tunnel-manager Start up the ssh-tunnel-manager manager +# +# chkconfig: 2345 60 20 +# description: SSH-Tunnel-Manager to manager multiple SSH connections to different servers. +# +# config: /etc/ssh-tunnel-manager.conf + +### BEGIN INIT INFO +# Provides: ssh-tunnel-manager +# Required-Start: $network sshd +# Required-Stop: $network sshd +# Should-Start: +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start up the ssh-tunnel-manager manager +# Description: SSH-Tunnel-Manager to manager multiple SSH connections to different servers. +### END INIT INFO + +# Source function library. +#. /etc/rc.d/init.d/functions + +exec="/usr/sbin/ssh-tunnel-manager" +prog="ssh-tunnel-manager" +config="/etc/ssh-tunnel-manager.conf" + + +start() { + [ -x $exec ] || exit 5 + [ -f $config ] || exit 6 + $exec start +} + +stop() { + $exec start +} + +restart() { + stop + start +} + +rh_status() { + $exec status +} + + +case "$1" in + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart) + $1 + ;; + status) + rh_status + ;; + *) + echo $"Usage: $0 {start|stop|status|restart}" + exit 2 +esac +exit $? \ No newline at end of file