diff --git a/bin/install.sh b/bin/install.sh index 954ac8815..2463fb7f4 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -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) @@ -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") @@ -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"