From 1ba594d3573dd370f5e49a815cd2d46dc14c4d88 Mon Sep 17 00:00:00 2001 From: glen Date: Fri, 5 Mar 2021 14:27:28 -0500 Subject: [PATCH] next --- acquire.sh | 5 ---- installers/acquire.sh | 5 ++++ installers/install.sh | 61 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 5 deletions(-) delete mode 100644 acquire.sh create mode 100644 installers/acquire.sh create mode 100755 installers/install.sh diff --git a/acquire.sh b/acquire.sh deleted file mode 100644 index 177ba17..0000000 --- a/acquire.sh +++ /dev/null @@ -1,5 +0,0 @@ -UPDATE_URL="https://raw.githubusercontent.com/necro-nemesis/Rapsberry-Pi-OS-Lokinet/main/" -wget -q ${UPDATE_URL}/install -O /tmp/install -source /tmp/install && rm -f /tmp/install - -install_lokinet diff --git a/installers/acquire.sh b/installers/acquire.sh new file mode 100644 index 0000000..221e043 --- /dev/null +++ b/installers/acquire.sh @@ -0,0 +1,5 @@ +UPDATE_URL="https://raw.githubusercontent.com/necro-nemesis/Raspberry-Pi-OS-Lokinet/main/" +wget -q ${UPDATE_URL}/installers/install.sh -O /tmp/install.sh +source /tmp/install.sh && rm -f /tmp/install.sh + +install_lokinet diff --git a/installers/install.sh b/installers/install.sh new file mode 100755 index 0000000..6c40361 --- /dev/null +++ b/installers/install.sh @@ -0,0 +1,61 @@ +lokinet_dir="/tmp/lokinet" + +function show_splash() { + + cyan='\033[1;36m' + + echo -e "${cyan}\n" + echo -e " _ _ _ _ " + echo -e " | | | | (_) | | " + echo -e " | | ___ | | ___ _ __ ___| |_ " + echo -e " | | / _ \| |/ / | '_ \ / _ \ __| " + echo -e " | |___| (_) | <| | | | | __/ |_" + echo -e " \_____/\___/|_|\_\_|_| |_|\___|\__| " + +echo "Install public key and add packages." +} + +function install_main () { + sudo modprobe tun + sudo curl -so /etc/apt/trusted.gpg.d/oxen.gpg https://deb.oxen.io/pub.gpg + echo "deb https://deb.oxen.io $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/oxen.list + +echo "Resync package repositories." + + sudo apt update + +echo "Install Lokinet-GUI" + + sudo apt install lokinet-gui -y +} + +function resolv_config () { + +echo "Install resolvconf and configure" + + sudo apt install resolvconf -y + sudo resolvconf -u + sudo systemctl restart lokinet + +} + # Fetches latest files from github to lokinet installation directory + function download_latest_files() { + + if [ -d "$lokinet_dir" ]; then + sudo mv $lokinet_dir "$lokinet_dir.`date +%F-%R`" || install_error "Unable to remove old lokinet-installer directory" + fi + + install_log "Cloning latest files from github" + git clone --depth 1 https://github.com/necro-nemesis/Raspberry-Pi-OS-Lokinet $lokinet_dir || install_error "Unable to download files from github" + sudo mv $lokinet_dir/Lokinet.desktop /usr/share/applications/ || install_error "Unable to add startup entry" + sudo mv $lokinet_dir/img/lokiremove.png /usr/pixmaps/ || install_error "Unable to add startup icon" + + } + +function install_lokinet () { + show_splash + download_latest_files + install_main + resolv_config + echo "Installation complete!" +}