projects
/
grml-scripts-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2b92b06
)
Drop usage of $UID in scripts; Do not use a negative exit value in shellscripts
author
Michael Prokop
<mika@grml.org>
Thu, 29 Oct 2009 12:14:12 +0000
(13:14 +0100)
committer
Michael Prokop
<mika@grml.org>
Thu, 29 Oct 2009 12:14:12 +0000
(13:14 +0100)
debian/changelog
patch
|
blob
|
history
usr_bin/caps-ctrl
patch
|
blob
|
history
usr_bin/grml-lang
patch
|
blob
|
history
usr_bin/say
patch
|
blob
|
history
usr_sbin/grml-setservices
patch
|
blob
|
history
usr_sbin/grml-tpm
patch
|
blob
|
history
usr_sbin/ndiswrapper.sh
patch
|
blob
|
history
usr_sbin/prepare_ramdisk.sh
patch
|
blob
|
history
usr_sbin/prepare_tmpfs.sh
patch
|
blob
|
history
diff --git
a/debian/changelog
b/debian/changelog
index
93c1ec8
..
9460639
100644
(file)
--- a/
debian/changelog
+++ b/
debian/changelog
@@
-1,3
+1,10
@@
+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 ]
grml-scripts (1.1.28) unstable; urgency=low
[ Ulrich Dangel ]
diff --git
a/usr_bin/caps-ctrl
b/usr_bin/caps-ctrl
index
b0d8f64
..
8096e42
100755
(executable)
--- a/
usr_bin/caps-ctrl
+++ b/
usr_bin/caps-ctrl
@@
-15,9
+15,9
@@
emulate zsh
autoload -U colors ; colors
if [[ -z $DISPLAY ]] ; then # test if X is not running when calling us
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 "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
eerror "Run this program with root permissions. Exiting." ; eend 1
exit 1
fi
diff --git
a/usr_bin/grml-lang
b/usr_bin/grml-lang
index
3376d4c
..
ee8bcd3
100755
(executable)
--- a/
usr_bin/grml-lang
+++ b/
usr_bin/grml-lang
@@
-26,7
+26,7
@@
setvalue(){
if [ $# -lt "1" ] ; then
usage
if [ $# -lt "1" ] ; then
usage
- exit
-
1
+ exit 1
fi
[ -d /etc/sysconfig ] || sudo mkdir /etc/sysconfig
fi
[ -d /etc/sysconfig ] || sudo mkdir /etc/sysconfig
diff --git
a/usr_bin/say
b/usr_bin/say
index
4d18e44
..
0f3bf16
100755
(executable)
--- a/
usr_bin/say
+++ b/
usr_bin/say
@@
-8,7
+8,7
@@
if [ $# -eq 0 ] ; then
echo "Usage: $0 <text_to_say>"
if [ $# -eq 0 ] ; then
echo "Usage: $0 <text_to_say>"
- exit
-
1
+ exit 1
fi
if [ -x /usr/bin/flite ] ; then
fi
if [ -x /usr/bin/flite ] ; then
diff --git
a/usr_sbin/grml-setservices
b/usr_sbin/grml-setservices
index
633ea9b
..
1d8e146
100755
(executable)
--- a/
usr_sbin/grml-setservices
+++ b/
usr_sbin/grml-setservices
@@
-1,4
+1,4
@@
-#!/bin/sh
+#!/bin/
ba
sh
# Filename: grml-setservices
# Purpose: interface for basic configuration of system startup
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Filename: grml-setservices
# Purpose: interface for basic configuration of system startup
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
@@
-21,7
+21,7
@@
bailout(){
exit 0
}
exit 0
}
-trap bailout
SIGHUP SIGINT SIGQUIT SIG
TERM
+trap bailout
HUP INT QUIT
TERM
is_value_set(){
[ -n "$1" ] || return 2
is_value_set(){
[ -n "$1" ] || return 2
diff --git
a/usr_sbin/grml-tpm
b/usr_sbin/grml-tpm
index
17000ef
..
07e2093
100755
(executable)
--- a/
usr_sbin/grml-tpm
+++ b/
usr_sbin/grml-tpm
@@
-8,7
+8,7
@@
. /etc/grml/lsb-functions
. /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
eerror Error: become root before starting $0 >& 2 ; eend 1
exit 100
fi
diff --git
a/usr_sbin/ndiswrapper.sh
b/usr_sbin/ndiswrapper.sh
index
38e03d1
..
f0531af
100755
(executable)
--- a/
usr_sbin/ndiswrapper.sh
+++ b/
usr_sbin/ndiswrapper.sh
@@
-10,7
+10,7
@@
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin"
export PATH
# Get root
export PATH
# Get root
-if [ $
UID
!= 0 ] ; then
+if [ $
(id -u)
!= 0 ] ; then
echo Error: become root before starting $0 >& 2
exit 100
fi
echo Error: become root before starting $0 >& 2
exit 100
fi
diff --git
a/usr_sbin/prepare_ramdisk.sh
b/usr_sbin/prepare_ramdisk.sh
index
7e94187
..
e7018fb
100755
(executable)
--- a/
usr_sbin/prepare_ramdisk.sh
+++ b/
usr_sbin/prepare_ramdisk.sh
@@
-6,7
+6,7
@@
# License: This file is licensed under the GPL v2.
################################################################################
# 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
echo "Error: $0 requires root permissions. Exiting."
exit 1
fi
diff --git
a/usr_sbin/prepare_tmpfs.sh
b/usr_sbin/prepare_tmpfs.sh
index
3208fcc
..
229fa79
100755
(executable)
--- a/
usr_sbin/prepare_tmpfs.sh
+++ b/
usr_sbin/prepare_tmpfs.sh
@@
-6,7
+6,7
@@
# License: This file is licensed under the GPL v2.
################################################################################
# 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
echo "Error: $0 requires root permissions. Exiting."
exit 1
fi