Browse Source

style: a few tab fixes, check root for reboot and poweroff

canon
ix 5 years ago
parent
commit
2cd7e85f18
  1. 9
      poweroff
  2. 9
      reboot
  3. 3
      urc

9
poweroff

@ -4,4 +4,11 @@
# (c) ix 2016
#
kill -s USR1 1
check_root() {
if [ "$(id -u)" != "0" ]; then
echo "poweroff: Operation not permitted."
exit 1
fi
}
check_root && kill -s USR1 1

9
reboot

@ -4,4 +4,11 @@
# (c) ix 2016
#
kill -s INT 1
check_root() {
if [ "$(id -u)" != "0" ]; then
echo "reboot: Operation not permitted."
exit 1
fi
}
check_root && kill -s INT 1

3
urc

@ -63,7 +63,7 @@ on_boot() {
/sbin/udevadm trigger --action=add --type=devices
elif [ "$UDEV" = "smdev" ]; then
/sbin/smdev -s
echo /sbin/smdev > /proc/sys/kernel/hotplug
echo /sbin/smdev > /proc/sys/kernel/hotplug
else
/sbin/busybox mdev -s
echo /sbin/mdev > /proc/sys/kernel/hotplug
@ -124,7 +124,6 @@ on_shutdown() {
echo Unmounting fstab.
umount -a -r
echo Unmounting swap.
/sbin/swapoff -a

Loading…
Cancel
Save