mirror of
https://github.com/karl0ss/AnotterKiosk.git
synced 2025-07-28 03:00:16 +01:00
final fix?
This commit is contained in:
parent
ca7a2b615f
commit
249327a8cc
@ -2,7 +2,7 @@
|
|||||||
# This script is being run on the target debian platform
|
# This script is being run on the target debian platform
|
||||||
|
|
||||||
apt update
|
apt update
|
||||||
DEBIAN_FRONTEND=noninteractive apt install -y lightdm openbox nginx php-fpm php-cli chromium autossh unclutter x11-xserver-utils xdotool htop nano openssh-server rsync x11vnc lm-sensors ntpdate scrot wireless-regdb fontconfig php-cli
|
DEBIAN_FRONTEND=noninteractive apt install -y lightdm openbox nginx php-fpm php-cli chromium autossh unclutter x11-xserver-utils xdotool htop nano openssh-server rsync x11vnc lm-sensors ntpdate scrot wireless-regdb fontconfig php-cli uuid-runtime
|
||||||
|
|
||||||
rsync -a --chown=root:root "/kiosk_skeleton/." "/"
|
rsync -a --chown=root:root "/kiosk_skeleton/." "/"
|
||||||
chmod +x /usr/bin/kiosk-* /usr/bin/get-ini /usr/bin/refresh-screen /usr/bin/schedule-* /usr/bin/setup-refresh-timer
|
chmod +x /usr/bin/kiosk-* /usr/bin/get-ini /usr/bin/refresh-screen /usr/bin/schedule-* /usr/bin/setup-refresh-timer
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Configure WiFi from kioskbrowser.ini
|
Description=Generate NetworkManager connection profile from kioskbrowser.ini
|
||||||
Requires=NetworkManager.service
|
Before=NetworkManager.service
|
||||||
After=NetworkManager.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Redirect all output to a log file for debugging
|
set -e
|
||||||
exec &> /var/log/kiosk-wifi.log
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
echo "--- Kiosk WiFi Configuration Starting ---"
|
echo "Generating NetworkManager connection profile..."
|
||||||
date
|
|
||||||
|
|
||||||
echo "Reading configuration from /boot/kioskbrowser.ini..."
|
|
||||||
WIFI_SSID=$(get-ini /boot/kioskbrowser.ini wifi ssid)
|
WIFI_SSID=$(get-ini /boot/kioskbrowser.ini wifi ssid)
|
||||||
WIFI_PSK=$(get-ini /boot/kioskbrowser.ini wifi psk)
|
WIFI_PSK=$(get-ini /boot/kioskbrowser.ini wifi psk)
|
||||||
|
|
||||||
@ -15,27 +11,36 @@ if [ -z "${WIFI_SSID}" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Configuration found: SSID='${WIFI_SSID}'"
|
# Generate a UUID for the connection
|
||||||
|
UUID=$(uuidgen)
|
||||||
|
|
||||||
echo "Waiting for WiFi adapter to be ready..."
|
# Create the NetworkManager connection file
|
||||||
sleep 5
|
cat > "/etc/NetworkManager/system-connections/${WIFI_SSID}.nmconnection" << EOF
|
||||||
|
[connection]
|
||||||
|
id=${WIFI_SSID}
|
||||||
|
uuid=${UUID}
|
||||||
|
type=wifi
|
||||||
|
interface-name=wlan0
|
||||||
|
autoconnect=true
|
||||||
|
|
||||||
echo "Checking radio status..."
|
[wifi]
|
||||||
nmcli radio all
|
mode=infrastructure
|
||||||
|
ssid=${WIFI_SSID}
|
||||||
|
|
||||||
echo "Ensuring WiFi radio is on..."
|
[wifi-security]
|
||||||
nmcli radio wifi on
|
auth-alg=open
|
||||||
|
key-mgmt=wpa-psk
|
||||||
|
psk=${WIFI_PSK}
|
||||||
|
|
||||||
echo "Checking device status..."
|
[ipv4]
|
||||||
nmcli device status
|
method=auto
|
||||||
|
|
||||||
echo "Attempting to connect to WiFi network..."
|
[ipv6]
|
||||||
nmcli device wifi connect "${WIFI_SSID}" password "${WIFI_PSK}"
|
method=auto
|
||||||
|
EOF
|
||||||
|
|
||||||
echo "Waiting a few seconds for connection to establish..."
|
# Set the correct permissions
|
||||||
sleep 10
|
chmod 600 "/etc/NetworkManager/system-connections/${WIFI_SSID}.nmconnection"
|
||||||
|
chown root:root "/etc/NetworkManager/system-connections/${WIFI_SSID}.nmconnection"
|
||||||
|
|
||||||
echo "Final connection status:"
|
echo "Successfully created connection profile for ${WIFI_SSID}."
|
||||||
nmcli connection show
|
|
||||||
|
|
||||||
echo "--- Kiosk WiFi Configuration Finished ---"
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user