Tiny Core Base > CorePlus

⚡➔❌ Press Power Button to Shutdown

(1/5) > >>

evertvaningen:
PRESS POWER BUTTON TO SHUTDOWN✍

The idea is that a independent (no screen, keyboard or mouse) Internet radio can be started with a press of the power button and everything boots automatically. When you're done with listening you press the power button and Tiny Core Linux shuts down to be used another day.

Tiny Core Linux does not do this by default and I tried following the tutorial: http://wiki.tinycorelinux.net/wiki:using_acpid_to_control_your_pc_buttons

This is all Chinese to me...
Can one explain to me how it's done?

Juanito:
google is your friend...

evertvaningen:
Please...

Juanito:
I'm sure with even a cursory search you will find several acpi scripts to suspend or shut-down when the power button is (briefly) pressed.

evertvaningen:
Like...


--- Quote ---That's simple enough. When you press the power button a ACPI event triggers the script at /etc/acpi/powerbtn.sh.

You can edit that to just run shutdown -h now as the first thing so it looks like:


--- Quote ---#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.

/sbin/shutdown -h now "Power button pressed"
exit 0

# leave the old code below (in case you want to revert!)
--- End quote ---

--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version