1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00
raspap-webgui/ajax/openvpn/del_ovpncfg.php

15 lines
434 B
PHP
Raw Normal View History

2021-02-07 12:50:52 +01:00
<?php
2023-02-16 23:25:43 +01:00
require '../../includes/csrf.php';
2021-02-07 12:50:52 +01:00
require_once '../../includes/config.php';
require_once '../../includes/functions.php';
if (isset($_POST['cfg_id'])) {
2023-02-17 19:05:36 +01:00
$ovpncfg_id = escapeshellcmd($_POST['cfg_id']);
2021-02-07 12:50:52 +01:00
$ovpncfg_files = pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME).'/'.$ovpncfg_id.'_*.conf';
exec("sudo rm $ovpncfg_files", $return);
$jsonData = ['return'=>$return];
echo json_encode($jsonData);
}