2020-05-09 22:49:37 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Define log functions if they do not exist yet
|
|
|
|
type -t info >/dev/null 2>&1
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
info () {
|
|
|
|
echo "$SELF:" "$@" | tee /dev/kmsg
|
|
|
|
}
|
|
|
|
|
|
|
|
warn () {
|
|
|
|
echo "$SELF:" "$@" >&2 | tee /dev/kmsg
|
|
|
|
}
|
|
|
|
|
|
|
|
die () {
|
|
|
|
local return_code=$1
|
|
|
|
shift
|
|
|
|
warn "$@"
|
|
|
|
exit $return_code
|
|
|
|
}
|
2021-01-13 10:37:30 +00:00
|
|
|
|
|
|
|
die_notif () {
|
|
|
|
local return_code=$1
|
|
|
|
shift
|
|
|
|
warn "$@"
|
|
|
|
notif "$@"
|
|
|
|
exit $return_code
|
|
|
|
}
|
2020-05-09 22:49:37 +01:00
|
|
|
fi
|
2020-10-25 20:53:26 +00:00
|
|
|
|
|
|
|
notif () {
|
|
|
|
info "$@"
|
|
|
|
printf "$@" > /sys/class/graphics/fb0/notification
|
|
|
|
}
|
|
|
|
|
|
|
|
clear_notif () {
|
|
|
|
printf "clear" > /sys/class/graphics/fb0/notification
|
|
|
|
}
|