Merge pull request #28 from necro-nemesis/staging

Update master from staging
pull/29/head
necro-nemesis 6 years ago committed by GitHub
commit 0edef5bc06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,10 +15,16 @@ case "$1" in
;; ;;
gen) gen)
systemctl stop lokinet
echo -n "NEW lokinet.ini FILE CREATED\n" echo -n "NEW lokinet.ini FILE CREATED\n"
lokinet "-g" tmpdir=$(mktemp --tmpdir -d lokinet.XXXXXXXXXX)
cp /root/.lokinet/lokinet.ini /usr/local/bin/ /usr/bin/lokinet -g $tmpdir/lokinet.ini
cat /usr/local/bin/lokinet.ini sudo sed -i -e "s#$tmpdir#/var/lib/lokinet#" $tmpdir/lokinet.ini
chmod 640 $tmpdir/lokinet.ini
chgrp _loki $tmpdir/lokinet.ini
mv -f $tmpdir/lokinet.ini /var/lib/lokinet/lokinet.ini
cat /var/lib/lokinet/lokinet.ini
systemctl start lokinet
;; ;;
bootstrap) bootstrap)

@ -388,7 +388,7 @@ function DisplayLokinetConfig()
echo '<input type="submit" class="btn btn-success" name="StopDaemon" value="Stop Daemon" />' , PHP_EOL; echo '<input type="submit" class="btn btn-success" name="StopDaemon" value="Stop Daemon" />' , PHP_EOL;
} }
$filename = '/usr/local/bin/lokinet.ini'; $filename = '/var/lib/lokinet/lokinet.ini';
if (file_exists($filename)) { if (file_exists($filename)) {
echo '<input type="submit" class="btn btn-success" name="ReGenerateLokinet" value="Regenerate .ini" />' , PHP_EOL; echo '<input type="submit" class="btn btn-success" name="ReGenerateLokinet" value="Regenerate .ini" />' , PHP_EOL;
@ -596,64 +596,72 @@ function SaveTORAndVPNConfig()
foreach ($return as $line) { foreach ($return as $line) {
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL; echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
} }
/* Lokinet script commands start HERE
////
//// LOKINET
////
//*/
//START
} elseif (isset($_POST['StartDaemon'])) { } elseif (isset($_POST['StartDaemon'])) {
?> /*?>
<div class="alert alert-success"> <div class="alert alert-success">
Launching Lokinet. Launching Lokinet.
</div> </div>
<?php <?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh start'); $output = */
echo "<pre><strong>$output</strong></pre>"; shell_exec('sudo /var/lib/lokinet/lokilaunch.sh start');
/* echo "<pre><strong>$output</strong></pre>";
*/
//STOP
} elseif (isset($_POST['StopDaemon'])) { } elseif (isset($_POST['StopDaemon'])) {
?> ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
Exiting Lokinet. Exiting Lokinet.
</div> </div>
<?php <?php
?> ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
Stopping Lokinet background daemon process. Stopping Lokinet background daemon process.
</div> </div>
<?php <?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh stop'); $output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh stop');
echo "<pre><strong>$output</strong></pre>"; echo "<pre><strong>$output</strong></pre>";
//GENERATE LOKINET.INI
} elseif (isset($_POST['GenerateLokinet'])) { } elseif (isset($_POST['GenerateLokinet'])) {
?> ?>
<div class="alert alert-success"> <div class="alert alert-success">
Generating Lokinet Configuration Generating Lokinet Configuration
</div> </div>
<?php <?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh gen'); $output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh gen');
echo "<pre><strong>$output</strong></pre>"; echo "<pre><strong>$output</strong></pre>";
//REGENERATE LOKINET.INI
} elseif (isset($_POST['ReGenerateLokinet'])) { } elseif (isset($_POST['ReGenerateLokinet'])) {
?> ?>
<div class="alert alert-success"> <div class="alert alert-success">
Regenerating Lokinet Configuration Regenerating Lokinet Configuration
</div> </div>
<?php <?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh gen'); $output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh gen');
echo "<pre><strong>$output</strong></pre>"; echo "<pre><strong>$output</strong></pre>";
//APPLY LOKINET-BOOTSTRAP
} elseif (isset($_POST['ApplyLokinetSettings'])) { } elseif (isset($_POST['ApplyLokinetSettings'])) {
?> ?>
<div class="alert alert-danger"> <div class="alert alert-danger">
Exiting Lokinet.
</div>
<?php
?>
<div class="alert alert-danger">
Stopping Lokinet background daemon process. Stopping Lokinet background daemon process.
</div> </div>
<?php <div class="alert alert-success">
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh stop');
echo "<pre><strong>$output</strong></pre>";
$bootstrap = $_POST['lokinetbootstrap'];
?>
<div class="alert alert-success">
Applying Bootstrap Applying Bootstrap
</div> </div>
<?php <?php
$bootstrap=str_replace("'", "", $bootstrap); $bootstrap = $_POST['lokinetbootstrap'];
$output = shell_exec('sudo /home/pi/./loki-network/lokilaunch.sh bootstrap '.$bootstrap.''); $bootstrap=str_replace("'", "", $bootstrap);
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh bootstrap '.$bootstrap.'');
echo "<pre><strong>$output</strong></pre>"; echo "<pre><strong>$output</strong></pre>";
} }
} }

@ -275,8 +275,8 @@ function patch_system_files() {
"/bin/cp /etc/raspap/networking/dhcpcd.conf /etc/dhcpcd.conf" "/bin/cp /etc/raspap/networking/dhcpcd.conf /etc/dhcpcd.conf"
"/etc/raspap/hostapd/enablelog.sh" "/etc/raspap/hostapd/enablelog.sh"
"/etc/raspap/hostapd/disablelog.sh" "/etc/raspap/hostapd/disablelog.sh"
"/var/lib/lokinet/lokilaunch.sh*" "/var/lib/lokinet/lokilaunch.sh"
) )
# Check if sudoers needs patching # Check if sudoers needs patching

Loading…
Cancel
Save