Updated the p3 build script.

This commit is contained in:
Storm Dragon
2023-08-19 19:51:59 -04:00
parent 110e7d9253
commit 7d15478e18
7 changed files with 112 additions and 18 deletions

View File

@ -1,14 +1,16 @@
#!/bin/bash
trap 'popd &> /dev/null' EXIT
export SUDO_ASKPASS=/etc/audibleprompt.sh
if [[ ! -d /opt/configure-stormux ]]; then
# Offer to switch fenrir layout.
echo "Would you like to switch Fenrir to laptop layout? (y/n)"
read -r continue
continue="${continue::1}"
if [[ "${continue,}" == "y" ]];then
sudo sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
sudo systemctl restart fenrirscreenreader.service
sudo -A sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
sudo -A systemctl restart fenrirscreenreader.service
clear
fi
if ! ping -c1 stormux.org &> /dev/null ; then
@ -24,19 +26,19 @@ if [[ ! -d /opt/configure-stormux ]]; then
nmtui-connect
fi
# Check for internet connectivity
if ping -qc1 -W 1 gnu.org &> /dev/null; then
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 date -s "$date_time"
sudo -A date -s "$date_time"
else
echo "Please connect to the internet and run ${0##*/} again."
exit 1
fi
echo "Installing configure-stormux..."
sudo git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
sudo -A git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
fi
pushd /opt/configure-stormux