Update Installer.sh
Added Name and Hostname dialogs. Added MOTD and Updater.sh downloads.
This commit is contained in:
parent
0eaf87f622
commit
c3faa18dbf
11
Installer.sh
11
Installer.sh
@ -4,8 +4,6 @@
|
||||
# Static Vars #
|
||||
##---------------##
|
||||
|
||||
sed -i -e 's/magenta/blue/g' /etc/newt/palette
|
||||
#OUTPUT='/dev/null'
|
||||
OUTPUT='>/dev/null 2>&1'
|
||||
APTMODE="debconf-apt-progress -- apt"
|
||||
REPO=PiAutomation
|
||||
@ -54,6 +52,8 @@ if [[ $INSTALL == no ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
NAME=$(whiptail --nocancel --inputbox "What is your name?" 8 39 John --title "Welcome" 3>&1 1>&2 2>&3)
|
||||
HOST=$(whiptail --nocancel --inputbox "What is the name of this machine?" 8 39 Raspberry --title "Welcome $NAME!" 3>&1 1>&2 2>&3)
|
||||
|
||||
##-------------##
|
||||
# Pre-Check #
|
||||
@ -90,6 +90,8 @@ OPTIONS=$(whiptail --title "Configure Options" --checklist \
|
||||
TERM=ansi whiptail --title "Pi Automation" --infobox "Configuring Raspberry Pi" 8 78
|
||||
sleep 3
|
||||
|
||||
hostnamectl set-hostname $HOST
|
||||
|
||||
if grep -Fxq "country=NL" /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
then
|
||||
echo "Wifi properly configured"
|
||||
@ -192,7 +194,6 @@ if [[ $OPTIONS == *"Zigbee2MQTT"* ]]; then
|
||||
cd /opt/zigbee2mqtt/
|
||||
npm ci /opt/zigbee2mqtt/
|
||||
npm audit fix
|
||||
|
||||
npm start /opt/zigbee2mqtt/
|
||||
cd ~
|
||||
wget $GIT/$REPO/$BRANCH/Zigbee/z2mqtt.service -O /etc/systemd/system/zigbee2mqtt.service
|
||||
@ -219,5 +220,9 @@ sed -i 's/\"//g' /etc/installedmodules
|
||||
# Finishing #
|
||||
##-------------##
|
||||
|
||||
wget $GIT/$REPO/$BRANCH/Updater.sh -O /opt/updater.sh
|
||||
wget $GIT/$REPO/$BRANCH/MOTD/greetings.sh -O /etc/profile.d/greeting.sh
|
||||
sed -i -e "s/%name%/$NAME/g" /etc/profile.d/greeting.sh
|
||||
|
||||
whiptail --title "Done!" --msgbox "Please insert the Zigbee Dongle into a USB 2.0 port. Hit OK to continue." 8 78
|
||||
reboot
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user