now using config/info files

This commit is contained in:
rootzoll
2018-12-06 14:36:02 +01:00
parent e4d9d8de81
commit 843042b8f7
23 changed files with 194 additions and 327 deletions

View File

@@ -4,6 +4,12 @@ echo ""
# add bonus scripts
./91addBonus.sh
# load setup config
source /home/admin/raspiblitz.info
# load version
source /home/admin/_version.info
###### SWAP & FS
echo "*** SWAP file ***"
swapExists=$(swapon -s | grep -c /mnt/hdd/swapfile)
@@ -84,13 +90,30 @@ dialog --backtitle "RaspiBlitz - Setup" --title " RaspiBlitz Setup is done :) "
" 10 42
# set the hostname inputed on initDialog
hostname=`cat .hostname`
echo "Setting new network hostname '$hostname'"
sudo raspi-config nonint do_hostname ${hostname}
if [ ${#hostname} -gt 0 ]; then
echo "Setting new network hostname '$hostname'"
sudo raspi-config nonint do_hostname ${hostname}
else
echo "WARN: hostname not set"
fi
# mark setup is done (100%)
sudo sed -i "s/^setupStep=.*/setupStep=100/g" /home/admin/raspiblitz.info
# init the RASPIBLITZ Config
configFile="/mnt/hdd/raspiblitz.conf"
echo "# RASPIBLITZ CONFIG FILE" > $configFile
echo "raspiBlitzVersion='${codeVersion}'" >> $configFile
sudo chmod 777 ${configFile}
# transfer data from SD info file
echo "hostname=${hostname}" >> $configFile
echo "network=${network}" >> $configFile
echo "chain=${chain}" >> $configFile
# let migration/init script do the rest
./_bootstrap.migration.sh
clear
echo "Setup done. Rebooting now."
sudo shutdown -r now