Added inital modification for Kiosk version

This commit is contained in:
2022-09-14 17:00:04 +02:00
parent d19b2f3c1b
commit bd1b77c19e
21 changed files with 116 additions and 80 deletions

View File

@@ -0,0 +1,39 @@
#Clear screen on startup
clear
#Functions
NetCheck(){
unset counter
while [[ $counter -lt 3 && "$Net" = "false" ]]
do
sleep 5
ping -q -c1 ictmaatwerk.com &>/dev/null && Net=true || Net=false
counter=$(( $counter + 1 ))
done
}
#Check for network
echo "Waiting for network"
ping -q -c1 google.com &>/dev/null && Net=true || Net=false
#If no network enter wait loop
NetCheck
#Check for manual retry for netwerk
while [[ "$Net" = "false" ]]; do
read -p "Network could not be initialized, Try again (y/n) " yn
case $yn in
[yY]* )
NetCheck
break;;
[Nn]* ) break;;
* ) echo invalid response;;
esac
done
#Check if video and network are ok, else error out
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]] && [[ "$Net" = "true" ]]; then
echo "Loading, please wait..."
exec startx >/dev/null 2>&1
else
echo "System could not be initialized, exited"
sleep 10000
fi