83 lines
2.0 KiB
Bash
Executable File
83 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "🚀 Starting kiosk deployment..."
|
|
|
|
#REPO_DIR="/home/chris/projects/ClubhouseDisplays"
|
|
#SYSTEMD_DIR="/etc/systemd/system"
|
|
KIOSK_USER="kiosk-user"
|
|
KIOSK_USER_PASS="UckfieldRfc1954!"
|
|
KIOSK_URL="https://www.bbc.co.uk"
|
|
|
|
#!/bin/bash
|
|
|
|
# Create user if doesn't exist
|
|
if ! id -u "$KIOSK_USER" >/dev/null 2>&1; then
|
|
echo "Creating user: $KIOSK_USER"
|
|
sudo adduser --gecos "Kiosk User" --disabled-password "$KIOSK_USER"
|
|
echo "$KIOSK_USER:$KIOSK_USER_PASS" | sudo chpasswd
|
|
else
|
|
echo "User $KIOSK_USER already exists. Skipping creation."
|
|
fi
|
|
|
|
# Set up auto login
|
|
cat << EOF > /etc/gdm3/custom.conf
|
|
[daemon]
|
|
AutomaticLoginEnable=true
|
|
AutomaticLogin=$KIOSK_USER
|
|
EOF
|
|
|
|
# Create the autostart directory if it doesn't exist
|
|
mkdir -p /home/$KIOSK_USER/.config/autostart
|
|
|
|
# Create a startup script for Firefox
|
|
cat << EOF > /home/$KIOSK_USER/.config/autostart/firefox.desktop
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Exec=firefox -kiosk $KIOSK_URL
|
|
Hidden=false
|
|
NoDisplay=false
|
|
X-GNOME-Autostart-enabled=true
|
|
Name[en_US]=Firefox
|
|
Name=Firefox
|
|
Comment[en_US]=
|
|
Comment=
|
|
EOF
|
|
|
|
# Set the correct permissions for the startup script
|
|
sudo chmod 755 /home/$KIOSK_USER/.config/autostart/firefox.desktop
|
|
sudo chown -R $KIOSK_USER:$KIOSK_USER /home/$KIOSK_USER/.config
|
|
|
|
echo "🎉 Deployment complete! Rebooting..."
|
|
|
|
sleep 10
|
|
|
|
# Reboot the system
|
|
sudo reboot
|
|
|
|
# Make sure we are in the repo directory
|
|
#cd "$REPO_DIR" || { echo "❌ Repo directory not found at $REPO_DIR"; exit 1; }
|
|
|
|
# Make scripts executable
|
|
#chmod +x start-kiosk.sh
|
|
#chmod +x update-kiosk.sh
|
|
|
|
# Copy and install kiosk service
|
|
#sudo cp kiosk.service "$SYSTEMD_DIR/"
|
|
#sudo systemctl enable --now kiosk.service
|
|
|
|
# Copy and install update service and timer
|
|
#sudo cp update-kiosk.service "$SYSTEMD_DIR/"
|
|
#sudo cp update-kiosk.timer "$SYSTEMD_DIR/"
|
|
#sudo systemctl daemon-reexec
|
|
#sudo systemctl enable --now update-kiosk.timer
|
|
|
|
#echo "✅ Kiosk service and update timer are set up and running!"
|
|
|
|
# Optional: show status
|
|
#sudo systemctl status kiosk.service --no-pager -l
|
|
# sudo systemctl status update-kiosk.timer --no-pager -l
|
|
|
|
|