diff --git a/desec-dns.sh b/desec-dns.sh index 9266a7c..1fad569 100755 --- a/desec-dns.sh +++ b/desec-dns.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash # Screen prepare screen_size=$(stty size 2>/dev/null || echo 24 80) @@ -17,4 +17,5 @@ if [ -f ./functions.sh ]; then else echo "functions.sh does not exists" exit 1 -fi \ No newline at end of file +fi +echo "yes" \ No newline at end of file diff --git a/functions.sh b/functions.sh index f915b9c..1f7ac8c 100644 --- a/functions.sh +++ b/functions.sh @@ -8,6 +8,7 @@ setColors() { # shellcheck disable=SC2034 DONE="${COL_LIGHT_GREEN} done!${COL_NC}" OVER="\\r\\033[K" + FETT='\e[1m' } prepare_screen() { @@ -80,8 +81,6 @@ install_dependencies() { done if [[ "${#installArray[@]}" -gt 0 ]]; then printf " %b Processing %s install(s) for: %s, please wait...\\n" "${INFO}" "${PKG_MANAGER}" "${installArray[*]}" - printf '%*s\n' "$columns" '' | tr " " -; "${SUDO}" "${PKG_INSTALL[@]}" "${installArray[@]}" - printf '%*s\n' "$columns" '' | tr " " -; fi } \ No newline at end of file diff --git a/install.sh b/install.sh index 23f60e6..5181370 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash if [ -f ./functions.sh ]; then . ./functions.sh else @@ -14,16 +14,16 @@ show_ascii_berry # Must be root to install echo ":::" if [[ $EUID -eq 0 ]];then - echo "::: You are root." + echo "::: Du bist root." else - echo "::: sudo will be used for the install." + 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 "::: Please install sudo or run this as root." + echo "::: Bitte installiere sudo oder führe dieses Script als root aus." exit 1 fi fi @@ -31,4 +31,33 @@ printf ":::\\n\\n" # Check for dependencies install_dependencies whiptail -install_path=$(whiptail --inputbox "Text" "${r}" "${c}" 2>&1 >/dev/tty) \ No newline at end of file +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 \ No newline at end of file