Explorar el Código

check_reversetunnel added

master
Dirk Alders hace 5 meses
padre
commit
7ed140c151
Se han modificado 1 ficheros con 18 adiciones y 0 borrados
  1. 18
    0
      check_reversetunnel

+ 18
- 0
check_reversetunnel Ver fichero

@@ -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

Loading…
Cancelar
Guardar