From cf40fa5b38d3bc8e71fe0e89dc705738ba4a5ba9 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Thu, 25 Apr 2019 16:52:59 -0400 Subject: [PATCH 1/4] new atom install test --- installers/common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/installers/common.sh b/installers/common.sh index 3cfdfc7..3f2c7ed 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -1,3 +1,4 @@ +# test staging push raspap_dir="/etc/raspap" raspap_user="www-data" version=`sed 's/\..*//' /etc/debian_version` From 42792e0f3ac809ff5c43d4e6cc02e222c7bdadab Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Thu, 25 Apr 2019 18:58:58 -0400 Subject: [PATCH 2/4] Add connect and disconnect to launcher --- config/lokilaunch.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/config/lokilaunch.sh b/config/lokilaunch.sh index 184138a..ab12256 100644 --- a/config/lokilaunch.sh +++ b/config/lokilaunch.sh @@ -3,8 +3,11 @@ case "$1" in start) - echo -n "Starting LOKINET\n" + echo -n "Starting LOKINET daemon\n" lokinet > /dev/null 2>&1 & + ;; + + connect) ehco -n "rerouted iptables\n" sudo ip rule add from 10.3.141.1 lookup main prio 1000 echo -n "added wlan0 address rule\n" @@ -17,8 +20,11 @@ case "$1" in ;; stop) - echo -n "Stopping daemon\n" + echo -n "Stopping LOKINET daemon\n" pkill lokinet + ;; + +disconnect) sudo ip rule del from 10.3.141.1 lookup main prio 1000 #LOKIPAP echo -n "removed wlan0 address rule\n" sudo ip rule del from 10.3.141.0/24 lookup lokinet prio 1000 #LOKIPAP @@ -47,7 +53,7 @@ bootstrap) ;; *) - echo "Usage: "$1" {start|stop|gen|bootstrap}" + echo "Usage: "$1" {start|stop|gen|bootstrap|connect|disconnect}" exit 1 ;; esac From 7439b8e0bd14c44a3d3646916b81609e731cfde0 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Thu, 25 Apr 2019 19:04:58 -0400 Subject: [PATCH 3/4] Add start/stop service button --- includes/functions.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index c800ed3..7c9067c 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -344,6 +344,7 @@ function DisplayOpenVPNConfig() function DisplayLokinetConfig() { exec('pidof lokinet | wc -l', $lokinetstatus); + shell_exec('sudo iptables -t nat -L' > $networkstate) if ($lokinetstatus[0] == 0) { $status = '
Lokinet daemon is not running @@ -386,10 +387,15 @@ function DisplayLokinetConfig()
Contact Loki user groups for the latest bootstrap file location
' , PHP_EOL; + } else { + echo '' , PHP_EOL; + } if ($lokinetstatus[0] == 0) { - echo '' , PHP_EOL; + echo '' , PHP_EOL; } else { - echo '' , PHP_EOL; + echo '' , PHP_EOL; } $filename = '/usr/local/bin/lokinet.ini'; From a08e1f23b0c329da568ec99024f78fc49641dc8f Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Thu, 25 Apr 2019 19:05:39 -0400 Subject: [PATCH 4/4] start lokinet daemon with rc.local on start. --- installers/common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installers/common.sh b/installers/common.sh index 3f2c7ed..9ba922d 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -212,7 +212,8 @@ function default_configuration() { 'echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward #RASPAP' 'iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP' 'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP' - 'sudo \/etc\/init.d\/dnsmasq restart #RASPAP' + 'sudo lokinet > /dev/null 2>&1 & #RASPAP' + )