Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) skripts are compatible with Sun Solaris 10 now, OpenSolaris has not been tested yet (http://www.yacy-forum.de/viewtopic.php?p=37345#37345)

low01293a898f1f096
diff --git a/startYACY.sh b/startYACY.sh
index 32cda8c19..d24fafa69 100755
--- a/startYACY.sh
+++ b/startYACY.sh
@@ -1,7 +1,18 @@
#!/bin/sh
JAVA="`which java`"
LOGFILE="yacy.log"
-if [ "`id -u`" -eq 0 ]
+
+#check if OS is Sun Solaris or one of the OpenSolaris distributions and use different version of id if necessary
+if [ "`uname`" = "SunOS" ]
+then
+ # only this version of id supports the parameter -u
+ ID="/usr/xpg4/bin/id"
+else
+ # regular id for any other case (especially Linux and OSX)
+ ID="id"
+fi
+
+if [ "`$ID -u`" -eq 0 ]
then
echo
echo "For security reasons you should not run this script as root!"
diff --git a/startYACY_with_Updater.sh b/startYACY_with_Updater.sh
index b9e1c5758..efedaadb1 100644
--- a/startYACY_with_Updater.sh
+++ b/startYACY_with_Updater.sh
@@ -1,7 +1,18 @@
#!/bin/sh
JAVA="`which java`"
LOGFILE="yacy.log"
-if [ "`id -u`" -eq 0 ]
+
+#check if OS is Sun Solaris or one of the OpenSolaris distributions and use different version of id if necessary
+if [ "`uname`" = "SunOS" ]
+then
+ # only this version of id supports the parameter -u
+ ID="/usr/xpg4/bin/id"
+else
+ # regular id for any other case (especially Linux and OSX)
+ ID="id"
+fi
+
+if [ "`$ID -u`" -eq 0 ]
then
echo
echo "For security reasons you should not run this script as root!"