Archived
27 lines
784 B
Bash
Executable File
27 lines
784 B
Bash
Executable File
#!/bin/bash
|
|
# ---------------------------------------------------------------------------
|
|
# This script is triggered by an udev-rule in /etc/udev/rules.d/99-usbhalt.rules.
|
|
# It shuts down the system after plugout of any (!!) sd-device.
|
|
#
|
|
# Author: Bernhard Bablok
|
|
# License: GPL3
|
|
#
|
|
# Website: https://github.com/bablokb/pi-imgtank
|
|
#
|
|
# ---------------------------------------------------------------------------
|
|
|
|
source $(dirname "$0")/copy_mv_img2.inc
|
|
|
|
# --- global settings -----------------------------------------------------
|
|
|
|
setDefaults() {
|
|
setGlobalDefaults
|
|
}
|
|
|
|
# --- main program ---------------------------------------------------------
|
|
|
|
setDefaults
|
|
# no way to check the device: it is already removed :-(
|
|
msg "info: initiating system halt"
|
|
systemctl --no-block poweroff
|