Ok guys, all of this is very crappy, but u know, we do the best
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if ! ip link show tun0 &> /dev/null; then
|
if [ ! -e /tmp/.ynh-vpnclient-stopped ] && ! ip link show tun0 &> /dev/null; then
|
||||||
systemctl restart ynh-vpnclient &> /dev/null
|
systemctl restart ynh-vpnclient &> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -31,10 +31,12 @@ function ynh_setting_set($setting, $value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function stop_service() {
|
function stop_service() {
|
||||||
|
touch('/tmp/.ynh-vpnclient-stopped');
|
||||||
exec('sudo systemctl stop ynh-vpnclient');
|
exec('sudo systemctl stop ynh-vpnclient');
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_service() {
|
function start_service() {
|
||||||
|
unlink('/tmp/.ynh-vpnclient-stopped');
|
||||||
exec('sudo systemctl start ynh-vpnclient', $output, $retcode);
|
exec('sudo systemctl start ynh-vpnclient', $output, $retcode);
|
||||||
|
|
||||||
return $retcode;
|
return $retcode;
|
||||||
|
Reference in New Issue
Block a user