#!/bin/bash if [ -f ./functions.sh ]; then . ./functions.sh else echo "functions.sh does not exists" exit 1 fi ###### Prepare Environement ###### setColors prepare_screen package_manager_detect show_ascii_berry ######## FIRST CHECK ######## # Must be root to install echo ":::" if [[ $EUID -eq 0 ]];then echo "::: Du bist root." else echo "::: sudo wird zum Installieren benutzt." # Check if it is actually installed # If it isn't, exit because the install cannot complete if [[ $(command -v sudo) ]];then export SUDO="sudo" export SUDOE="sudo -E" else echo "::: Bitte installiere sudo oder führe dieses Script als root aus." exit 1 fi fi printf ":::\\n\\n" # Check for dependencies install_dependencies whiptail printf "\\n" install_path=$(whiptail --title "deSEC-DNS-GUI" --inputbox "Pfad in den Installiert werden soll" "${r}" "${c}" "/home/${USER}/deSEC-DNS-GUI" 2>&1 >/dev/tty) printf " %b deSEC-DNS-GUI wird nach $install_path installiert.\\n" "${INFO}" if [ ! -d "$install_path" ]; then mkdir $install_path fi printf " %b Kopieren der Programmdateien nach %s.\\n" "${INFO}" "${install_path}" cp $(pwd)/desec-dns.sh $install_path/desec-dns.sh cp $(pwd)/functions.sh $install_path/functions.sh if [ ! -x $install_path/desec-dns.sh ]; then chmod +x $install_path/desec-dns.sh fi printf "\\n" printf " %b Prüfe ob Installationsverzeichnis schon in PATH liegt...\\n" "${INFO}" case :$PATH: in *:$install_path:*) printf " %b Installationsverzeichnis liegt schon in PATH.\\n" "${TICK}" ;; *) printf " %b Installationsverzeichnis liegt noch nicht in PATH.\\n" "${CROSS}" printf "\\n" printf " %b Um das Programm von überall aufrufen zu können, muss noch\\n" "${INFO}" printf " der folgende Befehl in .bashrc oder eine ähnliche Datei eingetragen werden: \\n" printf ' %bexport PATH="$PATH:%s"%b' "${FETT}" "${install_path}" "${COL_NC}" printf "\\n" printf "\\n %b\\n\\n" "${DONE}" esac