[Dmraid-debian-commits] [SCM] Maintenance of the dmraid package branch, master, updated. debian/1.0.0.rc15-4-5-g2b08c89

Giuseppe Iuculano giuseppe at iuculano.it
Mon Mar 23 13:26:28 UTC 2009


The following commit has been merged in the master branch:
commit d03a5a3f1a6ad0ce17f0e66fbb4f3b14fb391c84
Author: Giuseppe Iuculano <giuseppe at iuculano.it>
Date:   Mon Mar 23 14:22:10 2009 +0100

    debian/dmraid.bug: execute su -c if user isn't root

diff --git a/debian/dmraid.bug b/debian/dmraid.bug
index 0a3ce1e..452b58c 100755
--- a/debian/dmraid.bug
+++ b/debian/dmraid.bug
@@ -23,12 +23,26 @@ if ! command -v yesno >/dev/null; then
   exec 3>&1
 fi
 
+root=$(id -u)
+
 echo "--- dmraid -r -vvv output" >&3
-dmraid -r -vvv >&3
+if ! [ "$root" = "0" ] ;then
+	echo "Only root can run dmraid -r -vvv, please type the root password"
+	su root -c "dmraid -r -vvv" >&3
+else
+	dmraid -r -vvv >&3
+fi
+
 echo >&3
 
+
 echo "--- dmraid -s -vv output" >&3
-dmraid -s -vv >&3
+if ! [ "$root" = "0" ] ;then
+	echo "Only root can run dmraid -s -vv, please type the root password"
+	su root -c "dmraid -s -vv" >&3
+else
+	dmraid -s -vv >&3
+fi
 echo >&3
 
 echo "--- /proc/partitions:" >&3

-- 
Maintenance of the dmraid package



More information about the Dmraid-debian-commits mailing list