Drop usage of $UID in scripts
authorMichael Prokop <mika@grml.org>
Thu, 29 Oct 2009 12:13:23 +0000 (13:13 +0100)
committerMichael Prokop <mika@grml.org>
Thu, 29 Oct 2009 12:13:23 +0000 (13:13 +0100)
bin/save-config
debian/changelog
sbin/grml-autoconfig

index e2f9854..63483c0 100755 (executable)
@@ -23,7 +23,7 @@
 
   LANG=C
   LC_ALL=C
-  [[ $UID != 0 ]] && runas='sudo' # important for /etc
+  [[ $(id -u) != 0 ]] && runas='sudo' # important for /etc
 
   check4progs mutt || echo "Warning, mutt not available for mail handling.">&2
   check4progs findchanged tar || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 }
index 9de9068..b3720b9 100644 (file)
@@ -1,3 +1,9 @@
+grml-autoconfig (0.8.41) unstable; urgency=low
+
+  * Drop usage of $UID in scripts.
+
+ -- Michael Prokop <mika@grml.org>  Thu, 29 Oct 2009 13:13:05 +0100
+
 grml-autoconfig (0.8.40) unstable; urgency=low
 
   [ Ulrich Dangel ]
index 9806ac3..03ad905 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # Filename:      grml-autoconfig
 # Purpose:       configuration interface for grml-autoconfig
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika(at)grml.org>
@@ -6,7 +6,7 @@
 # License:       This file is licensed under the GPL v2.
 ################################################################################
 
-if [ "$UID" != 0 ];  then
+if [ $(id -u) != 0 ] ; then
   echo "Error: please run this script with uid 0 (root)." ; exit 1
 fi