I wrote a simple script which runs when I'm shutting down my computer. I placed the script under /etc/init.d/ directory and link it back to /etc/rc0.d/. The link is soft link and its name is K99checkout-reminder.
Here's the result from listing files under /etc/rc0.d/:
lrwxrwxrwx 1 root root 24 Nov 17 18:10 K99checkout-reminder -> ../init.d/alert_checkout
Here's the content of alert_checkout:
#!/bin/bash
export DISPLAY=:0.0
if zenity --question --text="I guess you have a nice working day?"; then
zenity --info --text="Gr8! Now please
_______
|
|
|
v
DO NOT forget to CHECKOUT your working time at door.\n\nSee you next day!"
else
zenity --info --text="Thats really sad.\n\nGo checkout your time to finish your working.\n\nHave good dinner, go sleep early and have a nice day!"
fi
I tried to run the script under root privilege and it works fine:
$ /etc/rc0.d $ sudo ./K99checkout-reminder
Got an alert box appeared!
Is there anything that I'm missing here?
Thank you.