|
@@ -0,0 +1,18 @@
|
|
1
|
+#!/bin/sh
|
|
2
|
+#
|
|
3
|
+AUTOSSH_PIDs=$(pidof autossh)
|
|
4
|
+if [ -z $AUTOSSH_PIDs ]; then
|
|
5
|
+ # no autossh process running
|
|
6
|
+ echo "No autossh process is running!"
|
|
7
|
+ exit 2
|
|
8
|
+else
|
|
9
|
+ # there is an autossh process
|
|
10
|
+ ps x -q $AUTOSSH_PIDs | grep "\-R 10022:localhost:22.*mount-mockery.de$" 2>&1 > /dev/null
|
|
11
|
+ if [ $? -eq 0 ]; then
|
|
12
|
+ echo "The required autossh process is running"
|
|
13
|
+ exit 0
|
|
14
|
+ else
|
|
15
|
+ echo "There are autossh processes, but none of them fit to the required connection details"
|
|
16
|
+ exit 2
|
|
17
|
+ fi
|
|
18
|
+fi
|