|
@@ -50,6 +50,7 @@ TOX_NODES=
|
50
|
50
|
MESH_INSTALL_DIR=/var/lib
|
51
|
51
|
MESH_INSTALL_COMPLETED=/root/.mesh_setup_completed
|
52
|
52
|
MESH_INSTALL_SETUP=/root/.initial_mesh_setup
|
|
53
|
+MESH_AMNESIC=/root/.amnesic
|
53
|
54
|
|
54
|
55
|
function set_hostname {
|
55
|
56
|
DEFAULT_DOMAIN_NAME="$1"
|
|
@@ -525,6 +526,33 @@ function enable_batman_daemon {
|
525
|
526
|
systemctl daemon-reload
|
526
|
527
|
}
|
527
|
528
|
|
|
529
|
+function mesh_amnesic {
|
|
530
|
+ if [ ! -f $MESH_AMNESIC ]; then
|
|
531
|
+ if [ -f /etc/systemd/system/amnesic.service ]; then
|
|
532
|
+ systemctl disable amnesic
|
|
533
|
+ fi
|
|
534
|
+ return
|
|
535
|
+ fi
|
|
536
|
+
|
|
537
|
+ if [ ! -f /etc/systemd/system/amnesic.service ]; then
|
|
538
|
+ echo '[Unit]' > /etc/systemd/system/amnesic.service
|
|
539
|
+ echo 'Description=Amnesic Mesh' >> /etc/systemd/system/amnesic.service
|
|
540
|
+ echo '' >> /etc/systemd/system/amnesic.service
|
|
541
|
+ echo '[Service]' >> /etc/systemd/system/amnesic.service
|
|
542
|
+ echo 'Type=oneshot' >> /etc/systemd/system/amnesic.service
|
|
543
|
+ echo 'RemainAfterExit=true' >> /etc/systemd/system/amnesic.service
|
|
544
|
+ echo 'ExecStart=/bin/true' >> /etc/systemd/system/amnesic.service
|
|
545
|
+ echo 'ExecStop=TODO' >> /etc/systemd/system/amnesic.service
|
|
546
|
+ echo '' >> /etc/systemd/system/amnesic.service
|
|
547
|
+ echo '[Install]' >> /etc/systemd/system/amnesic.service
|
|
548
|
+ echo 'WantedBy=multi-user.target' >> /etc/systemd/system/amnesic.service
|
|
549
|
+
|
|
550
|
+ systemctl daemon-reload
|
|
551
|
+ fi
|
|
552
|
+ systemctl enable amnesic
|
|
553
|
+ systemctl start amnesic
|
|
554
|
+}
|
|
555
|
+
|
528
|
556
|
# whether to reset the identity
|
529
|
557
|
if [ $2 ]; then
|
530
|
558
|
if [[ "$2" == $"new"* ]]; then
|
|
@@ -559,6 +587,7 @@ if [ -f $MESH_INSTALL_SETUP ]; then
|
559
|
587
|
configure_zeronet
|
560
|
588
|
disable_password_logins
|
561
|
589
|
disable_screen_lock
|
|
590
|
+ mesh_amnesic
|
562
|
591
|
|
563
|
592
|
rm $MESH_INSTALL_SETUP
|
564
|
593
|
systemctl disable mesh-setup.service
|