Installation fertig gestellt

This commit is contained in:
eichehome 2021-09-26 23:05:58 +02:00
parent ce385bf8e9
commit c53c99d9af
3 changed files with 38 additions and 9 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/bash
# Screen prepare
screen_size=$(stty size 2>/dev/null || echo 24 80)
@ -18,3 +18,4 @@ else
echo "functions.sh does not exists"
exit 1
fi
echo "yes"

View file

@ -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
}

View file

@ -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)
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