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