Tiny Core Linux
General TC => Programming & Scripting - Unofficial => Topic started by: bogz007 on July 10, 2012, 10:45:36 PM
-
I'm trying to restrict users to specific applications (in this case, remmina with plugins), but no matter where I place/start my script, even after the specific application exits, tinycore still does not shutdown.
The script is meant to be flexible, calling on APPLICATION to specify what application to check on.
#!/bin/sh
APPLICATION='remmina'
while true
do
if ps ax | grep -v grep | grep $APPLICATION > /dev/null
then
echo "$APPLICATION running, everything is fine"
else
exitcheck.sh shutdown
fi
done
Can someone help me build a script that can shutdown tinycore if an application exits? (either closed by user or programmatically by another script, or errors, hopefully it won't matter...)
-
Hi bogz007
For starters, remina is spelled with one m.
-
... and IIRC, busybox ps wouldn't take "ax" options.
-
shutdown like this works for me, in a script or at the CLI
sudo poweroff
-
Hi bogz007
shutdown like this works for me, in a script or at the CLI
sudo poweroff
Don't do that if you want backup to run.
-
Hi bogz007
Apparently remmina is spelled with two ems, my eyes just had trouble seeing it in AppBrowser due to a small font.
-
Hi bogz007
shutdown like this works for me, in a script or at the CLI
sudo poweroff
Don't do that if you want backup to run.
Thanks for the tip, I've been looking for a way to shutdown without running backup (easily) yet still allow restore to function at start-up. "norestore" boot option doesn't allow to prohibit backup whilst allow restore. I make an extension for most settings, but some need to be loaded later (later than renaming tcz's would allow). Am not hijacking ok :)
Thanks again
-
Just add the shutdown command to where-ever you start the one app, right after it.
remmina
sudo poweroff