From c0b63ee7a8c6de2266709c4c27ac1e7b22826d94 Mon Sep 17 00:00:00 2001
From: jrandom <jrandom>
Date: Thu, 2 Sep 2004 05:02:53 +0000
Subject: [PATCH] bournification

---
 installer/resources/install_i2p_service_unix   | 4 ++--
 installer/resources/uninstall_i2p_service_unix | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/installer/resources/install_i2p_service_unix b/installer/resources/install_i2p_service_unix
index 9f5c2e19b9..1da3a8991a 100644
--- a/installer/resources/install_i2p_service_unix
+++ b/installer/resources/install_i2p_service_unix
@@ -15,7 +15,7 @@
 # Java Service Wrapper can be found at:
 # http://wrapper.tanukisoftware.org/doc/english/introduction.html
 
-if [ $UID -ne 0 ]; then
+if [ ! "X$USER" = "Xroot" ]; then
     echo "Sorry, you need root privileges to install services."
     exit 1
 fi
@@ -23,7 +23,7 @@ fi
 ERROR_MSG="Cannot determine operating system type. Please install the service manually."
 HOST_OS=`./osid`
 
-if [[ ! $HOST_OS || $HOST_OS = "unknown" ]]; then
+if [ "X$HOST_OS" = "X" -o "$HOST_OS" = "unknown" ]; then
     echo "$ERROR_MSG"
     exit 1
 fi
diff --git a/installer/resources/uninstall_i2p_service_unix b/installer/resources/uninstall_i2p_service_unix
index 091777c03b..bed91169d2 100644
--- a/installer/resources/uninstall_i2p_service_unix
+++ b/installer/resources/uninstall_i2p_service_unix
@@ -15,7 +15,7 @@
 # Java Service Wrapper can be found at:
 # http://wrapper.tanukisoftware.org/doc/english/introduction.html
 
-if [ $UID -ne 0 ]; then
+if [ ! "X$USER" = "Xroot" ]; then
     echo "Sorry, you need root privileges to uninstall services."
     exit 1
 fi
@@ -23,7 +23,7 @@ fi
 ERROR_MSG="Cannot determine operating system type. Please uninstall the service manually."
 HOST_OS=`./osid`
 
-if [[ ! $HOST_OS || $HOST_OS = "unknown" ]]; then
+if [ "X$HOST_OS" = "X" -o "$HOST_OS" = "unknown" ]; then
     echo "$ERROR_MSG"
     exit 1
 fi
-- 
GitLab