Re:Shutdown PC by removing SD Card
by asharp on Saturday November 19, 2011 @07:48AM
(#3255199)
Interesting, but why don't you use a udev rule?
Something like KERNEL=="sdg", RUN+="/usr/bin/madagascar"
and then you have madagascar check the environment variable ACTION for a 'remove', and when you see that run shutdown? (or just write straight into sysreq for instant poweroff)
Re:Shutdown PC by removing SD Card
by TMK on Saturday November 19, 2011 @08:12AM
(#3255225)
I'm not the biggest linux geek, so i'm not that familiar with writing udev rules, so it was easier for me just writing the script with c. Though should looking into writing udev rules. :)
Something like KERNEL=="sdg", RUN+="/usr/bin/madagascar" and then you have madagascar check the environment variable ACTION for a 'remove', and when you see that run shutdown? (or just write straight into sysreq for instant poweroff)