Update Installer.sh
Added dialog questions for username and hostname. Storing username in system. Added downloading of AddHost.sh tool to /opt/ Debian: Setting up configured hostname. Seting up timezone to Amsterdam. Removing default MOTD. Adding custom MOTD.
This commit is contained in:
parent
dc10e395db
commit
c9438d6b1b
26
Installer.sh
26
Installer.sh
@ -39,6 +39,12 @@ fi
|
|||||||
# Menu #
|
# Menu #
|
||||||
##----------##
|
##----------##
|
||||||
|
|
||||||
|
NAME=$(whiptail --nocancel --inputbox "What is your name?" 8 39 John --title "Welcome" 3>&1 1>&2 2>&3)
|
||||||
|
HOSTNAME=$(whiptail --nocancel --inputbox "What is the name of this machine?\n(only az-AZ 0-9 characters are allowed)" 8 43 PiHole --title "Welcome $NAME!" 3>&1 1>&2 2>&3)
|
||||||
|
HOSTNAME=$(echo $HOST | tr -dc '[:alnum:]\n\r')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [[ $dist == "Alpine" ]]; then
|
if [[ $dist == "Alpine" ]]; then
|
||||||
if (whiptail --title "Setup" --yesno "Use an APT-Cacher?" 8 78); then
|
if (whiptail --title "Setup" --yesno "Use an APT-Cacher?" 8 78); then
|
||||||
CACHE=$(whiptail --inputbox "What is the IP address for APT-Cacher?" 8 78 192.168.1.102 --title "Setup" 3>&1 1>&2 2>&3)
|
CACHE=$(whiptail --inputbox "What is the IP address for APT-Cacher?" 8 78 192.168.1.102 --title "Setup" 3>&1 1>&2 2>&3)
|
||||||
@ -117,7 +123,11 @@ if [[ $dist == "Alpine" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $dist == "Debian" ]]; then
|
if [[ $dist == "Debian" ]]; then
|
||||||
|
hostnamectl set-hostname $HOSTNAME
|
||||||
|
timedatectl set-timezone Europe/Amsterdam
|
||||||
IP=`hostname -I` && IP=$(echo $IP | cut -d' ' -f2,3)
|
IP=`hostname -I` && IP=$(echo $IP | cut -d' ' -f2,3)
|
||||||
|
rm /etc/motd
|
||||||
|
rm /etc/update-motd.d/10-uname
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /etc/pihole
|
mkdir -p /etc/pihole
|
||||||
@ -245,9 +255,25 @@ if [[ $L2R == "true" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
##--------------##
|
||||||
|
# Store Vars #
|
||||||
|
##--------------##
|
||||||
|
|
||||||
|
echo $NAME > /etc/username
|
||||||
|
#echo $OPTIONS >> /etc/installedmodules
|
||||||
|
#sed -i 's/\s\+/\n/g' /etc/installedmodules
|
||||||
|
#sed -i 's/\"//g' /etc/installedmodules
|
||||||
|
|
||||||
|
|
||||||
##-------------##
|
##-------------##
|
||||||
# Finishing #
|
# Finishing #
|
||||||
##-------------##
|
##-------------##
|
||||||
|
|
||||||
|
wget $GIT/$BRANCH/Tools/AddHost.sh -O /opt/AddHost.sh
|
||||||
|
|
||||||
|
if [[ $dist == "Debian" ]]; then
|
||||||
|
wget $GIT/$BRANCH/MOTD/greetings.sh -O /etc/profile.d/greeting.sh
|
||||||
|
fi
|
||||||
|
|
||||||
whiptail --title "Done!" --msgbox "Pi-Hole is now available on http://$IP/admin\n\nPress OK to continue." 10 78
|
whiptail --title "Done!" --msgbox "Pi-Hole is now available on http://$IP/admin\n\nPress OK to continue." 10 78
|
||||||
exit
|
exit
|
||||||
Loading…
x
Reference in New Issue
Block a user