Ok guys, all of this is very crappy, but u know, we do the best

This commit is contained in:
Julien Vaubourg
2016-08-14 22:57:48 +02:00
parent d5f0b913af
commit a999bcf80b
2 changed files with 3 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
#!/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
fi

View File

@@ -31,10 +31,12 @@ function ynh_setting_set($setting, $value) {
}
function stop_service() {
touch('/tmp/.ynh-vpnclient-stopped');
exec('sudo systemctl stop ynh-vpnclient');
}
function start_service() {
unlink('/tmp/.ynh-vpnclient-stopped');
exec('sudo systemctl start ynh-vpnclient', $output, $retcode);
return $retcode;