+grml-scripts (1.1.29) unstable; urgency=low
+
+ * Drop usage of $UID in scripts.
+ * Do not use a negative exit value in shellscripts.
+
+ -- Michael Prokop <mika@grml.org> Thu, 29 Oct 2009 13:13:41 +0100
+
grml-scripts (1.1.28) unstable; urgency=low
[ Ulrich Dangel ]
autoload -U colors ; colors
if [[ -z $DISPLAY ]] ; then # test if X is not running when calling us
- if [[ $UID != 0 ]] ; then # test if user root did invoke this command
+ if [ $(id -u) != 0 ] ; then # test if user root did invoke this command
eerror "As of Linux 2.6.15 you need root permissions for changing"
- eerror "the keyboard on console using loadkeys for security reasons."
+ eerror "the keyboard on console using loadkeys for security reasons."
eerror "Run this program with root permissions. Exiting." ; eend 1
exit 1
fi
if [ $# -lt "1" ] ; then
usage
- exit -1
+ exit 1
fi
[ -d /etc/sysconfig ] || sudo mkdir /etc/sysconfig
if [ $# -eq 0 ] ; then
echo "Usage: $0 <text_to_say>"
- exit -1
+ exit 1
fi
if [ -x /usr/bin/flite ] ; then
-#!/bin/sh
+#!/bin/bash
# Filename: grml-setservices
# Purpose: interface for basic configuration of system startup
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
exit 0
}
-trap bailout SIGHUP SIGINT SIGQUIT SIGTERM
+trap bailout HUP INT QUIT TERM
is_value_set(){
[ -n "$1" ] || return 2
. /etc/grml/lsb-functions
-if [ $UID != 0 ] ; then
+if [ $(id -u) != 0 ] ; then
eerror Error: become root before starting $0 >& 2 ; eend 1
exit 100
fi
export PATH
# Get root
-if [ $UID != 0 ] ; then
+if [ $(id -u) != 0 ] ; then
echo Error: become root before starting $0 >& 2
exit 100
fi
# License: This file is licensed under the GPL v2.
################################################################################
-if [ $UID != 0 ]; then
+if [ $(id -u) != 0 ] ; then
echo "Error: $0 requires root permissions. Exiting."
exit 1
fi
# License: This file is licensed under the GPL v2.
################################################################################
-if [ $UID != 0 ]; then
+if [ $(id -u) != 0 ] ; then
echo "Error: $0 requires root permissions. Exiting."
exit 1
fi