Dateien hochladen nach „bin“

This commit is contained in:
2022-11-11 11:23:46 +01:00
parent 6c9bee7a0f
commit 6e4aef2709
2 changed files with 1050 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
#!/bin/zsh
# description: Description comes here....
PID_FILE="/var/run/openconnect.pid";
start() {
echo "initiating connection...";
~/bin/gp-okta -q ~/.gp-okta.conf;
}
stop() {
# code to stop app comes here
sudo pkill -F "$PID_FILE";
sudo pkill "vpn-slice";
}
status() {
STATUS="openconnect not running";
RETCODE=1;
pPID=`pgrep openconnect`;
if [ "$pPID" -a -s "$PID_FILE" ];
then
rPID=`cat "$PID_FILE"`;
if [ "$pPID" = "$rPID" ]
then
STATUS="openconnect($pPID) is running";
RETCODE=0;
fi
fi
echo $STATUS;
exit $RETCODE;
}
case "$1" in
start)
if [ status ];
then
start;
else
echo "- already running";
fi
;;
stop)
if [ ! status ];
then
stop;
else
echo "- not running";
fi
stop;
;;
restart)
stop;
sleep 3;
start;
;;
status)
status;
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
esac
exit 0