From 148ce25af7bc2a6aec09894d9d652f0df67bec4a Mon Sep 17 00:00:00 2001 From: HungryHobo Date: Sun, 31 Oct 2010 19:48:41 +0000 Subject: [PATCH] Print an error if /etc/init.d/i2p is run as non-root so Ubuntu users aren't asked for a non-existing root password --- debian/scripts/init | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/scripts/init b/debian/scripts/init index 57efc1a2a..e196a9404 100755 --- a/debian/scripts/init +++ b/debian/scripts/init @@ -17,6 +17,11 @@ I2P () { su i2psvc -c "/usr/lib/i2p/i2prouter $1" } +if [ `id -un` != "root" ]; then + echo "This script ($0) must be run as root" + exit 1 +fi + case "$1" in start) log_daemon_msg "Starting I2P" "i2p"