]>
Commit | Line | Data |
---|---|---|
03f5c33a | 1 | #!/bin/sh |
2 | ||
20bb6dc8 | 3 | GLOBUS_LOCATION="@GLOBUS_LOCATION@" |
03f5c33a | 4 | export GLOBUS_LOCATION |
5 | ||
6 | . ${GLOBUS_LOCATION}/libexec/globus-script-initializer | |
7 | . ${libexecdir}/globus-sh-tools.sh | |
03f5c33a | 8 | |
9 | PID_FILE=${localstatedir}/sshd.pid | |
10 | ||
11 | case "$1" in | |
306c7e1a | 12 | start) |
13 | if [ ! -f $PID_FILE ]; then | |
cf7f6b8d | 14 | if [ ! -d $localstatedir ]; then |
15 | mkdir -p $localstatedir | |
16 | fi | |
306c7e1a | 17 | echo "Starting up GSI-OpenSSH sshd server" |
51836dc1 | 18 | ${sbindir}/sshd > /dev/null 2>&1 & |
306c7e1a | 19 | if [ $? -ne 0 ] ; then |
20 | echo "Failed to start up GSI-OpenSSH sshd server" | |
306c7e1a | 21 | fi |
22 | else | |
23 | echo "GSI-OpenSSH sshd is already running..." | |
24 | fi | |
25 | ;; | |
26 | ||
27 | stop) | |
28 | if [ -f $PID_FILE ] ; then | |
cf7f6b8d | 29 | pid=`cat $PID_FILE` |
30 | kill -TERM $pid | |
306c7e1a | 31 | sleep 2 |
cf7f6b8d | 32 | kill -TERM $pid 2> /dev/null |
306c7e1a | 33 | rm -f $PID_FILE |
34 | fi | |
35 | ;; | |
03f5c33a | 36 | |
37 | *) | |
306c7e1a | 38 | echo "Usage: $0 ( start | stop )" |
39 | exit 1 | |
03f5c33a | 40 | esac |
41 | ||
42 | exit 0 |