Updated configure-stormus stub file. Because it is ran initially as root, no need for the sudo calls. Also handle removal of the cron job that causes it to run on the first boot of the image.

This commit is contained in:
Storm Dragon 2023-09-24 15:47:42 -04:00
parent 7ed27d5c65
commit 4f7dbb4f82
1 changed files with 17 additions and 15 deletions

View File

@ -9,8 +9,8 @@ if [[ ! -d /opt/configure-stormux ]]; then
read -r continue
continue="${continue::1}"
if [[ "${continue,}" == "y" ]];then
sudo -A sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
sudo -A systemctl restart fenrirscreenreader.service
sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
systemctl restart fenrirscreenreader.service
clear
fi
if ! ping -c1 stormux.org &> /dev/null ; then
@ -25,20 +25,22 @@ if [[ ! -d /opt/configure-stormux ]]; then
read -r continue
nmtui-connect
fi
# Check for internet connectivity
if ping -qc1 -W 1 stormux.org &> /dev/null; then
echo "Updating the clock to prevent certificate errors..."
# Get current date and time
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
echo "Current date and time: $date_time"
# set date and time
sudo -A date -s "$date_time"
else
echo "Please connect to the internet and run ${0##*/} again."
exit 1
fi
# Check for internet connectivity
if ping -qc1 -W 1 stormux.org &> /dev/null; then
echo "Updating the clock to prevent certificate errors..."
# Get current date and time
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
echo "Current date and time: $date_time"
# set date and time
date -s "$date_time"
else
echo "Please connect to the internet and run ${0##*/} again."
exit 1
fi
echo "Installing configure-stormux..."
sudo -A git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
# The main script is installed, no need for first run any more.
rm -f /etc/chron.d/0firstrun
fi
pushd /opt/configure-stormux