Beginning of amnesic mesh
This commit is contained in:
parent
f8c28d5183
commit
1e626eb44d
|
@ -50,6 +50,7 @@ TOX_NODES=
|
||||||
MESH_INSTALL_DIR=/var/lib
|
MESH_INSTALL_DIR=/var/lib
|
||||||
MESH_INSTALL_COMPLETED=/root/.mesh_setup_completed
|
MESH_INSTALL_COMPLETED=/root/.mesh_setup_completed
|
||||||
MESH_INSTALL_SETUP=/root/.initial_mesh_setup
|
MESH_INSTALL_SETUP=/root/.initial_mesh_setup
|
||||||
|
MESH_AMNESIC=/root/.amnesic
|
||||||
|
|
||||||
function set_hostname {
|
function set_hostname {
|
||||||
DEFAULT_DOMAIN_NAME="$1"
|
DEFAULT_DOMAIN_NAME="$1"
|
||||||
|
@ -525,6 +526,33 @@ function enable_batman_daemon {
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mesh_amnesic {
|
||||||
|
if [ ! -f $MESH_AMNESIC ]; then
|
||||||
|
if [ -f /etc/systemd/system/amnesic.service ]; then
|
||||||
|
systemctl disable amnesic
|
||||||
|
fi
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f /etc/systemd/system/amnesic.service ]; then
|
||||||
|
echo '[Unit]' > /etc/systemd/system/amnesic.service
|
||||||
|
echo 'Description=Amnesic Mesh' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo '' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo '[Service]' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo 'Type=oneshot' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo 'RemainAfterExit=true' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo 'ExecStart=/bin/true' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo 'ExecStop=TODO' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo '' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo '[Install]' >> /etc/systemd/system/amnesic.service
|
||||||
|
echo 'WantedBy=multi-user.target' >> /etc/systemd/system/amnesic.service
|
||||||
|
|
||||||
|
systemctl daemon-reload
|
||||||
|
fi
|
||||||
|
systemctl enable amnesic
|
||||||
|
systemctl start amnesic
|
||||||
|
}
|
||||||
|
|
||||||
# whether to reset the identity
|
# whether to reset the identity
|
||||||
if [ $2 ]; then
|
if [ $2 ]; then
|
||||||
if [[ "$2" == $"new"* ]]; then
|
if [[ "$2" == $"new"* ]]; then
|
||||||
|
@ -559,6 +587,7 @@ if [ -f $MESH_INSTALL_SETUP ]; then
|
||||||
configure_zeronet
|
configure_zeronet
|
||||||
disable_password_logins
|
disable_password_logins
|
||||||
disable_screen_lock
|
disable_screen_lock
|
||||||
|
mesh_amnesic
|
||||||
|
|
||||||
rm $MESH_INSTALL_SETUP
|
rm $MESH_INSTALL_SETUP
|
||||||
systemctl disable mesh-setup.service
|
systemctl disable mesh-setup.service
|
||||||
|
|
Loading…
Reference in New Issue