mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Update wg-quick w/ systemd start/stop
This commit is contained in:
parent
0b3307ce1f
commit
7c1ef85bb8
2 changed files with 3 additions and 5 deletions
|
@ -14,13 +14,13 @@ function DisplayWireGuardConfig()
|
||||||
SaveWireGuardConfig($status);
|
SaveWireGuardConfig($status);
|
||||||
} elseif (isset($_POST['startwg'])) {
|
} elseif (isset($_POST['startwg'])) {
|
||||||
$status->addMessage('Attempting to start WireGuard', 'info');
|
$status->addMessage('Attempting to start WireGuard', 'info');
|
||||||
exec('sudo /usr/bin/wg-quick up wg0', $return);
|
exec('sudo /bin/systemctl start wg-quick@wg0', $return);
|
||||||
foreach ($return as $line) {
|
foreach ($return as $line) {
|
||||||
$status->addMessage($line, 'info');
|
$status->addMessage($line, 'info');
|
||||||
}
|
}
|
||||||
} elseif (isset($_POST['stopwg'])) {
|
} elseif (isset($_POST['stopwg'])) {
|
||||||
$status->addMessage('Attempting to stop WireGuard', 'info');
|
$status->addMessage('Attempting to stop WireGuard', 'info');
|
||||||
exec('sudo /usr/bin/wg-quick down wg0', $return);
|
exec('sudo /bin/systemctl stop wg-quick@wg0', $return);
|
||||||
foreach ($return as $line) {
|
foreach ($return as $line) {
|
||||||
$status->addMessage($line, 'info');
|
$status->addMessage($line, 'info');
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,7 @@ www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/wgdata /etc/wireguard/*.conf
|
||||||
www-data ALL=(ALL) NOPASSWD:/bin/mv /tmp/wg-*.key /etc/wireguard/wg-*.key
|
www-data ALL=(ALL) NOPASSWD:/bin/mv /tmp/wg-*.key /etc/wireguard/wg-*.key
|
||||||
www-data ALL=(ALL) NOPASSWD:/etc/raspap/adblock/update_blocklist.sh
|
www-data ALL=(ALL) NOPASSWD:/etc/raspap/adblock/update_blocklist.sh
|
||||||
www-data ALL=(ALL) NOPASSWD:/usr/bin/tee /tmp/wireguard.log
|
www-data ALL=(ALL) NOPASSWD:/usr/bin/tee /tmp/wireguard.log
|
||||||
www-data ALL=(ALL) NOPASSWD:/bin/systemctl status wg-quick@wg0
|
www-data ALL=(ALL) NOPASSWD:/bin/systemctl * wg-quick@wg0
|
||||||
www-data ALL=(ALL) NOPASSWD:/usr/bin/wg-quick up wg0
|
|
||||||
www-data ALL=(ALL) NOPASSWD:/usr/bin/wg-quick down wg0
|
|
||||||
www-data ALL=(ALL) NOPASSWD:/usr/bin/wg
|
www-data ALL=(ALL) NOPASSWD:/usr/bin/wg
|
||||||
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wireguard/*.conf
|
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wireguard/*.conf
|
||||||
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wireguard/wg-*.key
|
www-data ALL=(ALL) NOPASSWD:/bin/cat /etc/wireguard/wg-*.key
|
||||||
|
|
Loading…
Reference in a new issue