Adjustments to support workstation mode

This commit is contained in:
2026-02-27 14:30:51 -05:00
parent 6dbb650431
commit 77a250ce08
14 changed files with 93 additions and 73 deletions

View File

@@ -12,13 +12,13 @@ APP_VERSION="2.0.0"
function clean_exit() {
# Re-enable unattended-upgrades
if $restart_uu; then systemctl start unattended-upgrades; fi
if $restart_uu; then systemctl start unattended-upgrades >/dev/null 2>&1; fi
exit 0
}
function abort_exit() {
# Re-enable unattended-upgrades
if $restart_uu; then systemctl start unattended-upgrades; fi
if $restart_uu; then systemctl start unattended-upgrades >/dev/null 2>&1; fi
exit 1
}
@@ -45,16 +45,20 @@ function update_os() {
# Make sure OS is up to date
echo "Updating Operating System..."
sleep 5
if apt-get update && apt-get dist-upgrade -y
then
echo "...done."
echo ""
else
echo "A problem was encountered during installation."
echo "the command that failed was:"
echo " apt-get update && apt-get dist-upgrade -y"
abort_exit
fi
apt-get update -qq
if [[ "$kconfig" == "standalone" ]]
then
if apt-get dist-upgrade -y
then
echo "...done."
echo ""
else
echo "A problem was encountered during installation."
echo "the command that failed was:"
echo " apt-get update && apt-get dist-upgrade -y"
abort_exit
fi
fi
}
function remove_snap() {
@@ -112,7 +116,7 @@ function install_chromium() {
# Try to install chromium-browser package, but if that fails, add
# repository and install chromium package
echo "Installing chromium..."
while ! apt-get install -y chromium
while ! apt-get install -y chromium > /dev/null 2>&1
do
if add-apt-repository ppa:xtradeb/apps -y
then
@@ -235,7 +239,7 @@ function install_cups() {
echo ""
echo ""
echo "The cups print server has been installed."
echo "After the kiosk is set up and working, edit /etc/openkiosk.conf"
echo "After the kiosk is set up and working, edit /etc/openkiosk/openkiosk.conf"
echo "and set the TGT_URL parameter to:"
echo " https://localhost:631"
echo "to add or manage printers via the kiosk browser."
@@ -279,18 +283,18 @@ function set_kiosk_url() {
echo "back or forward in a page unless the page itself provides that"
echo "capability."
url_ok=false
server_url="file:/home/kioskuser/openkiosk_welcome.html"
while ! $url_ok
server_url="file:/etc/openkiosk/openkiosk_welcome.html"
while ! $url_ok
do
echo ""
echo "Please enter complete URL. Valid formats are:"
echo "\"http://somesite.com/somepage\""
echo "\"file:/path/to/file.name\""
echo ""
read -p "[file:/home/kioskuser/openkiosk_welcome.html] :" -r server_url
read -p "[file:/etc/openkiosk/openkiosk_welcome.html] :" -r server_url
if [[ $server_url == "" ]]
then
server_url="file:/home/kioskuser/openkiosk_welcome.html"
server_url="file:/etc/openkiosk/openkiosk_welcome.html"
fi
if [[ $server_url == "test" ]]
then
@@ -321,7 +325,7 @@ function set_kiosk_url() {
fi
fi
done
sed -i 's,'TGT_URL=.*','TGT_URL="\"$server_url\""',' /etc/openkiosk.conf
sed -i 's,'TGT_URL=.*','TGT_URL="\"$server_url\""',' /etc/openkiosk/openkiosk.conf
}
function set_kiosk_type() {
@@ -344,9 +348,9 @@ function set_kiosk_type() {
read poll_interval
echo ""
if [[ $poll_interval == "" ]]; then poll_interval=60; fi
sed -i 's,'POLL_INTERVAL=.*','POLL_INTERVAL="\"$poll_interval\""',' /etc/openkiosk.conf
sed -i 's,'POLL_INTERVAL=.*','POLL_INTERVAL="\"$poll_interval\""',' /etc/openkiosk/openkiosk.conf
echo "Disabling screen blanking."
sed -i 's,'INHIBIT_BLANK=.*','INHIBIT_BLANK="\"1\""',' /etc/openkiosk.conf
sed -i 's,'INHIBIT_BLANK=.*','INHIBIT_BLANK="\"1\""',' /etc/openkiosk/openkiosk.conf
type_choice="D"
;;
"i" | "I" | "")
@@ -375,7 +379,7 @@ continueok=false
while ! $continueok
do
read -p "Would you like to continue with OpenKiosk setup [Y/n]: " -r continueok
case "$continueok in
case "$continueok" in
"n" | "N")
echo "Cancelling setup."
clean_exit
@@ -406,8 +410,8 @@ echo "browser or pdf viewer in a full screen or windowed configuration only"
echo "on demand."
echo ""
echo "Which configuration would you like?"
kconfig=false
while ! $kconfig
kconfig="none"
while [[ "$kconfig" == "none" ]]
do
read -p "Would you like a [S]tandalone or a [W]orkstation configuration? [S/W]?: " -r kconfig
case "$kconfig" in
@@ -425,7 +429,7 @@ do
;;
*)
echo "Please enter S or W, or enter C to cancel installation."
kconfig=false
kconfig="none"
;;
esac
done
@@ -444,13 +448,13 @@ sleep 5
chmod +x usr/local/bin/*
case "$kconfig in
case "$kconfig" in
"standalone")
# Copy in the needed files
echo "Copying files..."
cp -vf usr/local/bin/* /usr/local/bin
cp -Rvf etc/* /etc/
cp -vf lib/systemd/system/getty@tty1.service /lib/systemd/system
cp -vf distfiles/usr/local/bin/* /usr/local/bin
cp -Rvf distfiles/etc/* /etc/
cp -vf distfiles/lib/systemd/system/getty@tty1.service /lib/systemd/system
rm /lib/systemd/system/ctrl-alt-del.target
ln -s /dev/null /lib/systemd/system/ctrl-alt-del.target
echo "...done."
@@ -488,8 +492,9 @@ case "$kconfig in
"workstation")
# Copy in the needed files
echo "Copying files..."
cp -vf usr/local/bin/* /usr/local/bin
cp -vf etc/openkiosk.conf /etc/
cp -vf distfiles/usr/local/bin/* /usr/local/bin
cp -vf distfiles/etc/openkiosk/openkiosk.conf /etc/openkiosk/
cp -vf distfiles/etc/openkiosk/openkiosk_welcome.html /etc/openkiosk/
install_chromium
install_cups
set_kiosk_url