mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-10-29 22:43:48 +00:00
39 lines
946 B
Text
39 lines
946 B
Text
|
#!/bin/sh -e
|
||
|
|
||
|
systemd_live() {
|
||
|
if [ ! -d /run/systemd/system ]; then
|
||
|
echo >&2 " Skipped: Current root is not booted."
|
||
|
exit 0
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
udevd_live() {
|
||
|
if [ ! -d /run/udev ]; then
|
||
|
echo >&2 " Skipped: Device manager is not running."
|
||
|
exit 0
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
each_conf() {
|
||
|
while read -r f; do
|
||
|
"$@" "$(basename "$f")"
|
||
|
done
|
||
|
}
|
||
|
|
||
|
case $1 in
|
||
|
catalog) /usr/bin/journalctl --update-catalog ;;
|
||
|
hwdb) /usr/bin/systemd-hwdb --usr update ;;
|
||
|
update) touch -c /usr ;;
|
||
|
sysusers) each_conf /usr/bin/systemd-sysusers ;;
|
||
|
tmpfiles) each_conf /usr/bin/systemd-tmpfiles --create ;;
|
||
|
|
||
|
daemon-reload) systemd_live; /usr/bin/systemctl daemon-reload ;;
|
||
|
udev-reload) udevd_live; /usr/bin/udevadm control --reload ;;
|
||
|
binfmt) systemd_live; each_conf /usr/lib/systemd/systemd-binfmt ;;
|
||
|
sysctl) systemd_live; each_conf /usr/lib/systemd/systemd-sysctl ;;
|
||
|
|
||
|
*) echo >&2 " Invalid operation '$1'"; exit 1 ;;
|
||
|
esac
|
||
|
|
||
|
exit 0
|