diff --git a/README.md b/README.md index 4ec5a05..22f95d5 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,6 @@ Install SBC Lokinet Micro Exit from shell prompt: ```sh $ wget -q https://git.io/J3dYg -O /tmp/microexit && bash /tmp/microexit ``` -The installer will update, locate, install and configure all the prerequisites for you. You will be prompted to create a new user account. At the end of the install process you will be presented with your Lokinet address. Either by starting the exit by answer "Y" or exiting the script "N" it will allow you to highlight the address and copy/paste this to clipboard or plug it directly into your Lokinet client to test your exit. diff --git a/installers/common.sh b/installers/common.sh index 12912f4..3bf9787 100644 --- a/installers/common.sh +++ b/installers/common.sh @@ -1,27 +1,27 @@ #create hostname account with root privelages. -function create_user () { - -install_log "Create Exit user account" - -if [ $(id -u) -eq 0 ]; then - read -p "Enter username : " username - read -s -p "Enter password : " password - egrep "^$username" /etc/passwd >/dev/null - if [ $? -eq 0 ]; then - echo "$username exists!" - exit 1 - else - pass=$(perl -e 'print crypt($ARGV[0], "password")' $password) - useradd -m -p $pass $username - sudo adduser $username sudo - [ $? -eq 0 ] && echo "User has been added to system!" || echo "Failed to add a user!" - fi -else - echo "Only root may add a user to the system" - exit 2 -fi - -} +# function create_user () { +# +# install_log "Create Exit user account" +# +# if [ $(id -u) -eq 0 ]; then +# read -p "Enter username : " username +# read -s -p "Enter password : " password +# egrep "^$username" /etc/passwd >/dev/null +# if [ $? -eq 0 ]; then +# echo "$username exists!" +# exit 1 +# else +# pass=$(perl -e 'print crypt($ARGV[0], "password")' $password) +# useradd -m -p $pass $username +# sudo adduser $username sudo +# [ $? -eq 0 ] && echo "User has been added to system!" || echo "Failed to add a user!" +# fi +# else +# echo "Only root may add a user to the system" +# exit 2 +# fi +# +# } # Outputs a Exit Install log line function install_log() { @@ -52,8 +52,8 @@ function display_welcome() { echo -e " \___ \| _ <| | " echo -e " ____) | |_) | |____ " echo -e "|_____/|____/ \_____| " - echo -e "${raspberry}\n" - echo -e " _ _ _ " + echo -e "${raspberry} _ _ _ " +# echo -e " _ _ _ " echo -e " (_) (_) | " echo -e " _ __ ___ _ ___ _ __ ___ _____ ___| |_ " echo -e " | '_ '_ \| |/ __| '__/ _ \ / _ \ \/ / | __| " @@ -63,6 +63,13 @@ function display_welcome() { echo -e "${green}\n" echo -e "Exit setup tool for SBCs." echo -e "The Quick Installer will guide you through a few easy steps\n\n" + echo -n "Continue with Lokinet Exit Installation? [y/N]: " + read answer + if [[ $answer != "y" ]]; then + echo "Installation aborted." + exit 0 + fi + } ### NOTE: all the below functions are overloadable for system-specific installs @@ -144,8 +151,8 @@ function configure_exit() { sudo systemctl restart lokinet #clean out installer files - sudo rm -r $exit_dir/installers || install_error "Unable to remove installers" - sudo rm -r /tmp/exit || install_error "Unable to remove /tmp/exit folder" + # sudo rm -r $exit_dir/installers || install_error "Unable to remove installers" + sudo rm -r /tmp/microexit || install_error "Unable to remove /tmp/microexit folder" #provide option to launch and display lokinet address @@ -158,10 +165,10 @@ function configure_exit() { exit_address=$(host -t cname localhost.loki $IP | awk '/alias for/ { print $6 }') install_warning "Your Lokinet Address is:\nhttp://${exit_address}" install_warning "Place your exit in ${exit_dir}" - echo -n "Do you wish to go live with exit? [y/N]: " + echo -n "Do you wish to immediately go live with the exit? [y/N]: " read answer if [[ $answer != "y" ]]; then - echo "Exit not launched. Exiting installation" + echo "Exit not launched. Will launch on next reboot. Exiting installation" exit 0 fi install_log "Exit Launching" @@ -174,7 +181,7 @@ function install_Exit() { update_system_packages install_dependencies stop_lokinet - create_user + # create_user # create_exit_directory # download_latest_files # change_file_ownership