From 2153d1e36c5834064f9c0b2455e2d601eef1762d Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 29 Oct 2009 13:13:23 +0100 Subject: [PATCH] Drop usage of $UID in scripts --- bin/save-config | 2 +- debian/changelog | 6 ++++++ sbin/grml-autoconfig | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/save-config b/bin/save-config index e2f9854..63483c0 100755 --- a/bin/save-config +++ b/bin/save-config @@ -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 } diff --git a/debian/changelog b/debian/changelog index 9de9068..b3720b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +grml-autoconfig (0.8.41) unstable; urgency=low + + * Drop usage of $UID in scripts. + + -- Michael Prokop Thu, 29 Oct 2009 13:13:05 +0100 + grml-autoconfig (0.8.40) unstable; urgency=low [ Ulrich Dangel ] diff --git a/sbin/grml-autoconfig b/sbin/grml-autoconfig index 9806ac3..03ad905 100755 --- a/sbin/grml-autoconfig +++ b/sbin/grml-autoconfig @@ -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 @@ -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 -- 2.1.4