From e982b78f24d1dca3d2bc92a39b8e9fcf35b39a37 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 9 Jan 2021 14:31:48 +0100 Subject: xml: op-mode: add preprocessor support as known from configuration mode --- op-mode-definitions/openvpn.xml.in | 139 +++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 op-mode-definitions/openvpn.xml.in (limited to 'op-mode-definitions/openvpn.xml.in') diff --git a/op-mode-definitions/openvpn.xml.in b/op-mode-definitions/openvpn.xml.in new file mode 100644 index 000000000..e9420904a --- /dev/null +++ b/op-mode-definitions/openvpn.xml.in @@ -0,0 +1,139 @@ + + + + + + + OpenVPN key generation tool + + + + + Generate shared-secret key with specified file name + + <filename> + + + + result=1; + key_path=$4 + full_path= + + if echo $key_path | egrep -ve '^/.*' > /dev/null; then + full_path=/config/auth/$key_path + else + full_path=$key_path + fi + + key_dir=`dirname $full_path` + if [ ! -d $key_dir ]; then + echo "Directory $key_dir does not exist!" + exit 1 + fi + + echo "Generating OpenVPN key to $full_path" + sudo /usr/sbin/openvpn --genkey --secret "$full_path" + result=$? + if [ $result = 0 ]; then + echo "Your new local OpenVPN key has been generated" + fi + /usr/libexec/vyos/validators/file-exists --directory /config/auth "$full_path" + + + + + + + + + Reset a service + + + + + + + Reset specified OpenVPN client + + + + + echo kill $4 | socat - UNIX-CONNECT:/run/openvpn/openvpn-mgmt-intf > /dev/null + + + + Reset OpenVPN process on interface + + + + + sudo ${vyos_op_scripts_dir}/reset_openvpn.py $4 + + + + + + + + + + + + Show OpenVPN interface information + + + + + Show detailed OpenVPN interface information + + ${vyos_op_scripts_dir}/show_interfaces.py --intf-type=openvpn --action=show + + + + + + Show OpenVPN interface information + + + + + ${vyos_op_scripts_dir}/show_interfaces.py --intf=$4 + + + + Show summary of specified OpenVPN interface information + + ${vyos_op_scripts_dir}/show_interfaces.py --intf="$4" --action=show-brief + + + + + + + + Show OpenVPN information + + + + + Show tunnel status for OpenVPN client interfaces + + sudo ${vyos_op_scripts_dir}/show_openvpn.py --mode=client + + + + Show tunnel status for OpenVPN server interfaces + + sudo ${vyos_op_scripts_dir}/show_openvpn.py --mode=server + + + + Show tunnel status for OpenVPN site-to-site interfaces + + sudo ${vyos_op_scripts_dir}/show_openvpn.py --mode=site-to-site + + + + + + -- cgit v1.2.3