mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2026-09-18 00:52:55 +02:00
build
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Run command before shutdown
|
||||
DefaultDependencies=no
|
||||
Before=shutdown.target reboot.target halt.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/true
|
||||
ExecStop=/usr/local/bin/pre-shutdown.sh
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
echo "System is shutting down at $(date)" >> /var/log/pre-shutdown.log
|
||||
|
||||
for i in `cat /proc/acpi/wakeup|grep enabled|awk '{ print $1 }'`
|
||||
do
|
||||
echo $i
|
||||
echo $i > /proc/acpi/wakeup
|
||||
done
|
||||
Reference in New Issue
Block a user