Update Installer.sh
Added datestamps to use in the Updater.sh script. Now saving username entered in the installer.
This commit is contained in:
parent
1c3c02e96c
commit
6c2c97cfda
17
Installer.sh
17
Installer.sh
@ -6,11 +6,13 @@
|
||||
|
||||
OUTPUT='>/dev/null 2>&1'
|
||||
APTMODE="debconf-apt-progress -- apt"
|
||||
DATE=$(date +"%m-%d-%Y")
|
||||
IP=`hostname -I`
|
||||
IP=$(echo $IP | tr -d ' ')
|
||||
REPO=PiAutomation
|
||||
GIT=https://raw.githubusercontent.com/Beeranco
|
||||
BRANCH=main
|
||||
|
||||
|
||||
##-----------##
|
||||
# Check OS #
|
||||
##-----------##
|
||||
@ -53,7 +55,7 @@ if [[ $INSTALL == no ]]; then
|
||||
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)
|
||||
HOST=$(whiptail --nocancel --inputbox "What is the name of this machine? (only az-AZ characters are allowd)" 8 39 Raspberry --title "Welcome $NAME!" 3>&1 1>&2 2>&3)
|
||||
|
||||
##-------------##
|
||||
# Pre-Check #
|
||||
@ -212,6 +214,7 @@ 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
|
||||
@ -220,20 +223,24 @@ sed -i 's/\"//g' /etc/installedmodules
|
||||
# Finishing #
|
||||
##-------------##
|
||||
|
||||
IP=`hostname -I`
|
||||
IP=$(echo $IP | tr -d ' ')
|
||||
|
||||
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
|
||||
|
||||
|
||||
mkdir -p /opt/backups/timestamps/
|
||||
echo "Installed on: $DATE" > /opt/backups/timestamps/OS.update
|
||||
|
||||
if grep -q Domoticz "/etc/installedmodules"; then
|
||||
echo "Installed on: $DATE" > /opt/backups/timestamps/Domoticz.update
|
||||
whiptail --title "Remember" --msgbox "After a reboot Domoticz is accessible on:\nhttp://$IP:8080" 8 78
|
||||
fi
|
||||
if grep -q Node-RED "/etc/installedmodules"; then
|
||||
echo "Installed on: $DATE" > /opt/backups/timestamps/NodeRED.update
|
||||
whiptail --title "Remember" --msgbox "After a reboot Node-RED is accessible on:\nhttp://$IP:1880" 8 78
|
||||
fi
|
||||
if grep -q Zigbee2MQTT "/etc/installedmodules"; then
|
||||
echo "Installed on: $DATE" > /opt/backups/timestamps/Zigbee2MQTT.update
|
||||
whiptail --title "Remember" --msgbox "After a reboot Zigbee2MQTT is accessible on:\nhttp://$IP:5002" 8 78
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user