removed WIFI
This commit is contained in:
29
install.sh
29
install.sh
@@ -5,33 +5,14 @@ REPO_URL="https://gitea.moto-adv.com/ske087/signage-player.git" # Replace with
|
|||||||
PROJECT_DIR="/home/pi/Desktop/ds-player" # Full path to the installation folder
|
PROJECT_DIR="/home/pi/Desktop/ds-player" # Full path to the installation folder
|
||||||
VENV_DIR="$PROJECT_DIR/venv" # Path to the virtual environment
|
VENV_DIR="$PROJECT_DIR/venv" # Path to the virtual environment
|
||||||
SERVICE_NAME="ds-player.service"
|
SERVICE_NAME="ds-player.service"
|
||||||
WIFI_SSID="CosaNostra" # Replace with your Wi-Fi SSID
|
|
||||||
WIFI_PASSWORD="Leonardo" # Replace with your Wi-Fi password
|
|
||||||
|
|
||||||
# Step 0: Check if Wi-Fi is enabled and connect to Wi-Fi
|
# Step 0: Check if an internet connection exists
|
||||||
echo "Checking if Wi-Fi is enabled..."
|
echo "Checking internet connection..."
|
||||||
if ! rfkill list wifi | grep -q "Soft blocked: no"; then
|
if ! ping -c 1 google.com &> /dev/null; then
|
||||||
echo "Wi-Fi is disabled. Enabling Wi-Fi..."
|
echo "No internet connection detected. Please ensure the device is connected to the internet."
|
||||||
rfkill unblock wifi
|
|
||||||
sleep 5
|
|
||||||
else
|
|
||||||
echo "Wi-Fi is already enabled."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Checking Wi-Fi connection..."
|
|
||||||
if ! iwgetid -r > /dev/null; then
|
|
||||||
echo "Not connected to Wi-Fi. Connecting to $WIFI_SSID..."
|
|
||||||
sudo bash -c "wpa_passphrase \"$WIFI_SSID\" \"$WIFI_PASSWORD\" > /etc/wpa_supplicant/wpa_supplicant.conf"
|
|
||||||
sudo wpa_cli -i wlan0 reconfigure
|
|
||||||
sleep 10
|
|
||||||
if iwgetid -r > /dev/null; then
|
|
||||||
echo "Successfully connected to Wi-Fi: $WIFI_SSID"
|
|
||||||
else
|
|
||||||
echo "Failed to connect to Wi-Fi. Please check your credentials."
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Already connected to Wi-Fi: $(iwgetid -r)"
|
echo "Internet connection is active."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 1: Check if the installation folder exists
|
# Step 1: Check if the installation folder exists
|
||||||
|
|||||||
Reference in New Issue
Block a user