Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifies the installer script to prevent freezing when network should be managed for Bullseye and older. #1905

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
24 changes: 23 additions & 1 deletion bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ if [ -f .env ]; then
source .env
fi

RASPBIAN_VERSION=$(lsb_release -rs)
WLAN_ON=false

# @TODO: Consider devices that uses Wi-Fi dongle.
if [ -f /sys/class/net/wlan0/operstate ] && [ "$(cat /sys/class/net/wlan0/operstate)" = "up" ]; then
WLAN_ON=true
fi

while getopts ":w:b:n:s:" arg; do
case "${arg}" in
w)
Expand Down Expand Up @@ -92,6 +100,21 @@ export BRANCH="master"

echo && read -p "Do you want Anthias to manage your network? This is recommended for most users because this adds features to manage your network. (Y/n)" -n 1 -r -s NETWORK && echo

if [ "$NETWORK" = 'y' ]; then
if [ "$RASPBIAN_VERSION" -lt 12 ] && [ "$WLAN_ON" = true ]; then
tput setaf 9

echo ""
echo "Anthias requires a wired Ethernet connection if you want to manage your network on this version of Raspberry Pi OS."
echo "Please connect your Raspberry Pi to the Internet and make sure that Wi-Fi is disabled."
echo "If you want to continue without network management, run the installer again and answer 'n' when prompted."
echo ""

tput sgr 0
exit 1
fi
fi

echo && read -p "Would you like to perform a full system upgrade as well? (y/N)" -n 1 -r -s UPGRADE && echo
if [ "$UPGRADE" != 'y' ]; then
EXTRA_ARGS=("--skip-tags" "system-upgrade")
Expand Down Expand Up @@ -152,7 +175,6 @@ if [ ! -f /etc/locale.gen ]; then
sudo locale-gen
fi

RASPBIAN_VERSION=$(lsb_release -rs)
APT_INSTALL_ARGS=(
"git"
"libffi-dev"
Expand Down
Loading