Skip to content

Commit

Permalink
Update create_latest_candle.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
flatsiedatsie committed Aug 29, 2022
1 parent 26a53de commit 4b02598
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions create_latest_candle.sh
Expand Up @@ -2439,6 +2439,7 @@ chown -R pi:pi /home/pi/candle/*




#
# DONE
#
Expand All @@ -2451,6 +2452,29 @@ if [ -f /boot/cmdline-candle.txt ]; then
fi


# Fix hostname issue from RC2
if [ -f /home/pi/.webthings/etc/hostname ] && [ -f /home/pi/.webthings/etc/hosts ]; then
hostname="$(cat /home/pi/.webthings/etc/hostname)"
if ! cat /etc/hosts | grep -q "$hostname"; then
echo "hostname was not in /etc/hosts. Attempting to fix."
echo "before:"
cat /home/pi/.webthings/etc/hosts
echo
sed -i -E -e "s|127\.0\.1\.1[ \t]+.*|127\.0\.1\.1 \t$hostname|" /home/pi/.webthings/etc/hosts
echo "after:"
cat /home/pi/.webthings/etc/hosts
echo
fi
else
echo
echo "Error, /home/pi/.webthings/etc/hostname and/or /home/pi/.webthings/etc/hosts did not exist"
echo "Candle: ERROR, /home/pi/.webthings/etc/hostname and/or /home/pi/.webthings/etc/hosts did not e>
echo "ERROR, /home/pi/.webthings/etc/hostname and/or /home/pi/.webthings/etc/hosts did not exist" >>>
exit 1
fi
# cp /home/pi/.webthings/etc/webthings_settings_backup.js /home/pi/.webthings/etc/webthings_settings.js
if [ -f /boot/candle_first_run_complete.txt ] && [ ! -f /boot/candle_original_version.txt ]; then
Expand Down Expand Up @@ -2503,6 +2527,9 @@ echo "$(date) - system update complete" >> /boot/candle_log.txt
# RUN DEBUG SCRIPT
if [ "$SKIP_DEBUG" = no ] || [[ -z "${SKIP_DEBUG}" ]];
Expand Down

0 comments on commit 4b02598

Please sign in to comment.