From 30c755eb1e1642f0cd731c41a560f05959976063 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Sun, 5 Jan 2020 13:13:16 -0500 Subject: [PATCH] replace network-manager with dhcpcd6 || halt lokinet earlier in script || remove space from sed to .ini file. --- installers/common.sh | 10 ++++++++-- installers/snappsetup.sh | 13 +++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index c00fe4e..607143d 100644 --- a/installers/common.sh +++ b/installers/common.sh @@ -71,6 +71,11 @@ function install_dependencies() { install_error "No function definition for install_dependencies" } +# Halts lokinet to allow for modifications to it +function stop_lokinet(){ + sudo systemctl stop lokinet.service +} + # Verifies existence and permissions of snapp directory function create_webpage_directory() { install_log "Creating webpage directory" @@ -106,8 +111,7 @@ function change_file_ownership() { function install_complete() { #append /var/lib/lokinet/lokinet.ini - sudo systemctl stop lokinet - sed -i '$ i\ keyfile=/var/lib/lokinet/snappkey.private' /var/lib/lokinet/lokinet.ini + sed -i '$ i\keyfile=/var/lib/lokinet/snappkey.private' /var/lib/lokinet/lokinet.ini sudo systemctl start lokinet #clean out installer files @@ -136,6 +140,8 @@ function install_pihost() { display_welcome update_system_packages install_dependencies + stop_lokinet + check_for_networkmananger create_user create_webpage_directory download_latest_files diff --git a/installers/snappsetup.sh b/installers/snappsetup.sh index 6b6d427..134d886 100644 --- a/installers/snappsetup.sh +++ b/installers/snappsetup.sh @@ -17,4 +17,17 @@ function install_dependencies() { sudo yes | apt-get install git screen dnsutils resolvconf lokinet || install_error "Unable to install dependencies" } +#Remove NetworkManager and install dhcpd if required. + +function check_for_networkmananger() { + install_log "Checking for NetworkManager" + echo "Checking for Network Manager" + if [ -f /lib/systemd/system/network-manager.service ]; then + echo "Network Manager found. Replacing with DHCPCD" + sudo apt-get -y purge network-manager + sudo apt-get -y install dhcpcd5 + fi + +} + install_pihost