Shell: Ksh 93u+m/1.0.0-beta.2 20021-12-17
I'm trying to display a Legal Notice that needs acceptance prior to the desktop login prompt being displayed.
I have a ksh93 shell script that uses zenity (3.42.1) to display a message, checkbox, and the buttons [Accept] and [Reject].
If the user does not accept the conditions in the message and does not 'tick' the checkbox then the only the [Reject] button is available.
If the user 'ticks' the checkbox and clicks on the [Accept] button the script will just terminate letting the normal login process continue. Otherwise the
script needs to get the system to power down using '/sbin/shutdown now -P' or something similar.
My problem is how and where to trigger the execution of the script.
Source of script:
Code: Select all
#!/bin/ksh93
FILE=`dirname $0`/LegalNotice.msg
zenity \
--text-info \
--title="Legal Notice" \
--width=510 \
--height=530 \
--filename=$FILE \
--checkbox="I have read and accept the legal notice." \
--ok-label="Accept"\
--cancel-label="Reject"
response=$?
if (($response != 0)); then
# shutdown the system.
echo "shutting down..."
#/sbin/shutdown now -P
fi