Added conf_file arguments to view scripts
This commit is contained in:
@@ -36,18 +36,18 @@ function set_commands() {
|
||||
elif echo "$TGT_URL" | grep -q '\.pdf$'
|
||||
then
|
||||
# The URL is a pdf file
|
||||
APP_CMD="kiosk_viewpdf $TGT_URL"
|
||||
APP_CMD="kiosk_viewpdf $TGT_URL $conf_file"
|
||||
ALIVE_STRING="xpdf"
|
||||
KILL_CMD="pkill xpdf"
|
||||
CLEANUP_CMD="kiosk_cleanup"
|
||||
debuglog "URL is a pdf file. Command is $PDF_APP_CMD"
|
||||
debuglog "URL is a pdf file. Command is $APP_CMD"
|
||||
else
|
||||
# Assume the URL returns HTML
|
||||
APP_CMD="kiosk_viewhtml $TGT_URL"
|
||||
APP_CMD="kiosk_viewhtml $TGT_URL $conf_file"
|
||||
ALIVE_STRING="chromium"
|
||||
KILL_CMD="pkill chromium"
|
||||
CLEANUP_CMD="kiosk_cleanup"
|
||||
debuglog "URL is an HTML file. Command is $HTML_APP_CMD"
|
||||
debuglog "URL is an HTML file. Command is $APP_CMD"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -3,15 +3,18 @@
|
||||
|
||||
if [ "$1" = "" ]
|
||||
then
|
||||
"You must supply a URL as an argument"
|
||||
"usage: kiosk_viewhtml <url> <config file path>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /etc/openkiosk.conf
|
||||
url="$1"
|
||||
conf_file="$2"
|
||||
|
||||
source $conf_file
|
||||
|
||||
if ! chromium --test-type --ignore-certificate-errors --kiosk \
|
||||
--no-first-run --check-for-update-interval=1 --simulate-upgrade \
|
||||
--incognito $1
|
||||
--incognito $url
|
||||
then
|
||||
kiosk_cleanup.sh
|
||||
xmessage -buttons "Ok:1" -center "Failed to retrieve web page."
|
||||
|
||||
@@ -3,18 +3,21 @@
|
||||
|
||||
if [ "$1" = "" ]
|
||||
then
|
||||
"You must supply a URL as an argument"
|
||||
"usage: kiosk_viewpdf <url> <config file path>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /etc/openkiosk.conf
|
||||
url="$1"
|
||||
conf_file="$2"
|
||||
|
||||
if echo "$1" | grep -q '^file:'
|
||||
source $conf_file
|
||||
|
||||
if echo "$url" | grep -q '^file:'
|
||||
then
|
||||
filepath=$(echo "$server_url"|cut -d"/" -f2-)
|
||||
xpdf -fullscreen -cont -z width $filepath
|
||||
else
|
||||
if ! wget -q -O /dev/shm/target.pdf $1
|
||||
if ! wget -q -O /dev/shm/target.pdf $url
|
||||
then
|
||||
kiosk_cleanup.sh
|
||||
xmessage -buttons "Ok:1" -center "Failed to retrieve pdf file."
|
||||
|
||||
Reference in New Issue
Block a user