From 9fd360d3a5b9fc50c17a6594b1a347b9d539d7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Aime?= Date: Fri, 18 Dec 2020 14:47:34 +0100 Subject: [PATCH] Updating the install.sh script related to the issue #21 --- install.sh | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 25fe91f..1e64599 100644 --- a/install.sh +++ b/install.sh @@ -38,6 +38,29 @@ check_operating_system() { fi } +set_credentials() { + # Set the credentials to access to the backend. + echo -e "\e[39m[+] Setting the backend credentials...\e[39m" + echo -n " Please choose a username for TinyCheck's backend: " + read login + echo -n " Please choose a password for TinyCheck's backend: " + read -s password1 + echo "" + echo -n " Please confirm the password: " + read -s password2 + echo "" + + if [ $password1 = $password2 ]; then + password=$(echo -n "$password1" | sha256sum | cut -d" " -f1) + sed -i "s/userlogin/$login/g" /usr/share/tinycheck/config.yaml + sed -i "s/userpassword/$password/g" /usr/share/tinycheck/config.yaml + echo -e "\e[92m [✔] Credentials saved successfully!\e[39m" + else + echo -e "\e[91m [✘] The passwords aren't equal, please retry.\e[39m" + set_credentials + fi +} + create_directory() { # Create the TinyCheck directory and move the whole stuff there. echo -e "[+] Creating TinyCheck folder under /usr/share/" @@ -275,7 +298,7 @@ cleaning() { systemctl disable suricata.service &> /dev/null # Removing some useless dependencies. - sudo apt autoremove -y + sudo apt autoremove -y &> /dev/null } check_wlan_interfaces() { @@ -334,6 +357,7 @@ else check_operating_system check_wlan_interfaces create_directory + set_credentials check_dependencies configure_dnsmask configure_dhcpcd @@ -348,4 +372,4 @@ else feeding_iocs cleaning reboot_box -fi +fi \ No newline at end of file