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)
systemctl stop lokinet
echo -n "NEW lokinet.ini FILE CREATED\n"
lokinet "-g"
cp /root/.lokinet/lokinet.ini /usr/local/bin/
cat /usr/local/bin/lokinet.ini
tmpdir=$(mktemp --tmpdir -d lokinet.XXXXXXXXXX)
/usr/bin/lokinet -g $tmpdir/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)

@ -388,7 +388,7 @@ function DisplayLokinetConfig()
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)) {
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) {
echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL;
}
/* Lokinet script commands start HERE
////
//// LOKINET
////
//*/
//START
} elseif (isset($_POST['StartDaemon'])) {
?>
/*?>
<div class="alert alert-success">
Launching Lokinet.
Launching Lokinet.
</div>
<?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh start');
echo "<pre><strong>$output</strong></pre>";
$output = */
shell_exec('sudo /var/lib/lokinet/lokilaunch.sh start');
/* echo "<pre><strong>$output</strong></pre>";
*/
//STOP
} elseif (isset($_POST['StopDaemon'])) {
?>
?>
<div class="alert alert-danger">
Exiting Lokinet.
Exiting Lokinet.
</div>
<?php
?>
<div class="alert alert-danger">
Stopping Lokinet background daemon process.
Stopping Lokinet background daemon process.
</div>
<?php
$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'])) {
?>
?>
<div class="alert alert-success">
Generating Lokinet Configuration
Generating Lokinet Configuration
</div>
<?php
$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'])) {
?>
?>
<div class="alert alert-success">
Regenerating Lokinet Configuration
Regenerating Lokinet Configuration
</div>
<?php
$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'])) {
?>
<div class="alert alert-danger">
Exiting Lokinet.
</div>
<?php
?>
<div class="alert alert-danger">
?>
<div class="alert alert-danger">
Stopping Lokinet background daemon process.
</div>
<?php
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh stop');
echo "<pre><strong>$output</strong></pre>";
$bootstrap = $_POST['lokinetbootstrap'];
?>
<div class="alert alert-success">
</div>
<div class="alert alert-success">
Applying Bootstrap
</div>
<?php
$bootstrap=str_replace("'", "", $bootstrap);
$output = shell_exec('sudo /home/pi/./loki-network/lokilaunch.sh bootstrap '.$bootstrap.'');
</div>
<?php
$bootstrap = $_POST['lokinetbootstrap'];
$bootstrap=str_replace("'", "", $bootstrap);
$output = shell_exec('sudo /var/lib/lokinet/lokilaunch.sh bootstrap '.$bootstrap.'');
echo "<pre><strong>$output</strong></pre>";
}
}

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

Loading…
Cancel
Save