#!/usr/bin/haserl <%in p/common.cgi %> <% page_title="Tunnel" conf_file=/tmp/vtund.conf env_host=$(fw_printenv -n vtun) if [ "$REQUEST_METHOD" = "POST" ]; then if [ "$POST_action" = "reset" ]; then killall -q tunnel killall -q vtund rm -f "$conf_file" fw_setenv vtun sleep 1 redirect_to "$SCRIPT_NAME" "danger" "Tunnel is down" fi if [ -n "$POST_vtun_host" ]; then fw_setenv vtun "$POST_vtun_host" /etc/init.d/S98vtun start sleep 1 redirect_to "$SCRIPT_NAME" "success" "Tunnel is up" fi fi %> <%in p/header.cgi %>
<% if [ -e "$conf_file" ]; then %>

Virtual Tunnel is up

Use the following credentials to set up remote access via virtual tunnel:

Tunnel ID
<%= ${network_macaddr//:/} | tr a-z A-Z %>
Password
<% grep password $conf_file | xargs | cut -d' ' -f2 | sed 's/;$//' %>
<% fi %>

Settings

<% if [ -n "$env_host" ]; then %> <% field_hidden "action" "reset" %> <% button_submit "Reset configuration" %> <% else %> <% field_text "vtun_host" "Virtual Tunnel address" %> <% button_submit %> <% fi %>

Configuration

<% [ -e "$conf_file" ] && ex "cat $conf_file" [ -n "$env_host" ] && ex "fw_printenv | grep vtun" ex "pgrep -a vtund" %>
<%in p/footer.cgi %>