Work on standalone mode

This commit is contained in:
2026-03-04 14:29:28 -05:00
parent 93af24430a
commit a4b176e7c6
4 changed files with 90 additions and 70 deletions

View File

@@ -31,7 +31,8 @@ ConditionPathExists=/dev/tty0
[Service]
# the VT is cleared by TTYVTDisallocate
ExecStart=-/sbin/agetty -a kioskuser --noclear %I $TERM
ExecStart=
ExecStart=-/sbin/agetty --autologin kioskuser --noclear %I $TERM
Type=idle
Restart=always
RestartSec=0

View File

@@ -11,7 +11,7 @@ url="$1"
conf_file="$2"
source $conf_file
if [[ "$EUID" == "0" || $(who|cut -d" " -f1) == "kioskuser" ]]
if [[ "$EUID" == "0" || $(whoami) == "kioskuser" ]]
then
# Use standalone args
chromargs="--test-type --ignore-certificate-errors --kiosk --no-first-run --check-for-update-interval=1 --simulate-upgrade --incognito"

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# openkiosk
if [[ "$EUID" == "0" || $(who|cut -d" " -f1) == "kioskuser" ]]
if [[ "$EUID" == "0" || $(whoami) == "kioskuser" ]]
then
conf_file="/etc/openkiosk/openkiosk.conf"
run_type="standalone"
@@ -111,17 +111,12 @@ function check_url() {
function debuglog() {
if [[ "$DEBUG" == "1" ]]
then
if [[ "$run_type" == "standalone" ]]
logfile="$HOME/openkiosk.log"
if [[ ! -e "$logfile" ]]
then
logfile_path="/var/log/openkiosk.log"
else
logfile_path="$HOME/openkiosk.log"
echo "openkiosk log started : "$(date +%Y-%m-%d %H:%M:%S) > $logfile
fi
if [[ ! -e "$logfile_path" ]]
then
echo "openkiosk log started : "$(date +%Y-%m-%d %H:%M:%S) > $logfile_path
fi
echo $(date +%H:%M:%S) "$1">>$logfile_path
echo $(date +%H:%M:%S) "$1">>$logfile
fi
}