Quantcast
Channel: SPS-Forum - Automatisierung und Elektrotechnik
Viewing all articles
Browse latest Browse all 50074

e!cockpit oVpn und config-tool

$
0
0
Servus Kollegen,

brauch bitte eure Hilfe.

Aufgabenstellung: Möchte Openvpn via config-tool in e!cockpit steuern. Habe dazu auch die Anleitung von Wago befolgt.

habe das File oVPN_state in /etc/config-tool eingefügt. Die Berechtigung zum Ausführen gegeben und den Baustein WagoAppConfigTool.FbConfigTool eingefügt.
WagoAppConfigTool.JPG
Mein Problem ist das ich keinen Status zurückbekomme.
habs natürlich auch mit './oVPN_state state' probiert.
oVPN_state sind inhaltlich so aus:
#!/bin/bash
if [ $1 == "start" ]
then
/etc/init.d/openvpn start
echo "start done"
elif [ $1 == "stop" ]
then
/etc/init.d/openvpn stop
echo "stop done"
elif [ $1 == "restart" ]
then
/etc/init.d/openvpn restart
echo "restart done"
elif [ $1 == "state" ]
then
active=$( ifconfig tun0| grep -cs 'inet addr:')
if [[ $active == 1 ]]
then
myip=$(ifconfig tun0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
echo "$myip"
else
echo "offline"
fi
fi
Kann mir da jemand weiterhelfen.

Danke.

Gumi
Angehängte Grafiken

Viewing all articles
Browse latest Browse all 50074


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>