From 4f7dbb4f827cfeb2a6ad562d935f19109c2f7b5e Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 24 Sep 2023 15:47:42 -0400 Subject: [PATCH] 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. --- pi4/files/usr/local/bin/configure-stormux | 32 ++++++++++++----------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/pi4/files/usr/local/bin/configure-stormux b/pi4/files/usr/local/bin/configure-stormux index 057ed66..ddbd2b5 100755 --- a/pi4/files/usr/local/bin/configure-stormux +++ b/pi4/files/usr/local/bin/configure-stormux @@ -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