Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /etc/systemd/system/
- [Unit]
- Description=executed at shutdown
- Conflicts=reboot.target
- After=network.target
- [Service]
- Type=oneshot
- ExecStart=/bin/true
- ExecStop=/path/to/script
- RemainAfterExit=yes
- [Install]
- WantedBy=multi-user.target
- #!/bin/sh
- echo 'the script is executed' > test.txt
- bash test_script.sh
- [Unit]
- Description=runs only upon shutdown
- Conflicts=reboot.target
- After=network.target
- [Service]
- Type=oneshot
- ExecStart=/bin/true
- ExecStop=[whatever you need to run]
- RemainAfterExit=yes
- [Install]
- WantedBy=multi-user.target
- [Service]
- User=osmc
- ExecStart=/bin/true
- ExecStop=/path/to/script
- RemainAfterExit=yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement