From: <abe...@us...> - 2015-12-05 14:21:23
|
Revision: 7373 http://sourceforge.net/p/astlinux/code/7373 Author: abelbeck Date: 2015-12-05 14:21:21 +0000 (Sat, 05 Dec 2015) Log Message: ----------- kernel-reboot, add a 'sync' and allow only root users Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/sbin/kernel-reboot Modified: branches/1.0/project/astlinux/target_skeleton/sbin/kernel-reboot =================================================================== --- branches/1.0/project/astlinux/target_skeleton/sbin/kernel-reboot 2015-12-05 02:54:14 UTC (rev 7372) +++ branches/1.0/project/astlinux/target_skeleton/sbin/kernel-reboot 2015-12-05 14:21:21 UTC (rev 7373) @@ -166,13 +166,13 @@ cd /root if [ ! -x /sbin/kexec ]; then - echo "You don't have kexec-tools installed - rebooting" + echo "kernel-reboot: You don't have kexec-tools installed - rebooting" >&2 reboot exit 1 fi if [ ! -x /sbin/findfs ]; then - echo "You don't have findfs installed - rebooting" + echo "kernel-reboot: You don't have findfs installed - rebooting" >&2 reboot exit 1 fi @@ -187,10 +187,17 @@ esac fi +if [ $(id -u) -ne 0 ]; then + echo "kernel-reboot: Operation not permitted, must be root" >&2 + exit 1 +fi + if [ -n "$DELAY" ] && [ $DELAY -gt 0 ]; then sleep $DELAY fi +sync + # Ignore terminating signals from here on trap '' HUP INT TERM This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |