summaryrefslogtreecommitdiff
blob: cf8e24ede4797822bafd58c25c8867e4db73cd8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
--- scripts/setup/nxserver.orig	2012-05-19 11:45:03.000000000 +0200
+++ scripts/setup/nxserver	2013-01-21 22:40:41.958166294 +0100
@@ -679,6 +679,10 @@
 
   printMsg "Verifying that all init scripts have been removed"
 
+  if [ "$system" = "gentoo" ]; then
+    return
+  fi
+
   runCommand "$RMCOMMAND -f /etc/init.d/nxserver" "Unable to remove '/etc/init.d/nxserver'" "warn"
 
   if [ "$system" = "solaris" ];
@@ -853,6 +857,10 @@
 
 addNXinit () {
 
+ if [ "$system" = "gentoo" ]; then
+   return
+ fi
+
  runCommand "cat $NODE_ROOT/scripts/init/nxserver > /etc/init.d/nxserver" "Unable to create: '/etc/init.d/nxserver'" "warn"
  runCommand "chmod +x /etc/init.d/nxserver" "Cannot set permissions of '/etc/init.d/nxserver' file" "warn"
 
@@ -967,6 +975,12 @@
 }
 
 addNXUserLinux () {
+
+  # does the NX user already exist?
+  if id nx > /dev/null 2>&1 ; then
+    return
+  fi
+
   if [ "x$system" != "xdebian" ]
   then
     sysuser=`useradd --help 2>&1|grep "\-r"`;
@@ -2679,6 +2693,11 @@
   system=fedora
 fi
 
+if grep -q "ID=gentoo" /etc/os-release || [ -f /etc/gentoo-release ];
+then
+  system=gentoo
+fi
+
 if [ "x$system" = "x" -a -f /etc/release ];
 then
   system=solaris
@@ -2713,6 +2732,7 @@
     "mandrake"           ) ;;
     "fedora"             ) ;;
     "debian"             ) ;;
+    "gentoo"             ) ;;
     "solaris"             ) ;;
     ""                 ) ARGS=-1 && errMsg="$PREFIX $ERROR ERROR: Unable to autodetect the operating system type, please specify it" ;;
     *                  ) ARGS=-1 && errMsg="$PREFIX $ERROR ERROR: Unsupported operating system '$system'" ;;
@@ -2892,21 +2912,6 @@
     fi
   fi
 
-  
-  result=`id nx 2>&1`
-  if [ $? = 0 ];
-  then
-#     printMsg "Cannot add user: nx. User: nx already exists" "error"
-#     printMsg "Please try to fix the problem by reinstalling the server" "error"
-    printMsg "Cannot add user: nx" "error"
-    printMsg "User: nx already exists" "error"
-    printMsgNoDot "To fix the problem, you may try to completely uninstall NX" 
-    printMsgNoDot "Server and install it from scratch. If this is not enough,"
-    printMsgNoDot "please delete the nx user by using the system commands and"
-    printMsg "proceed with a new installation of NX Server"
-    exit 1
-  fi
-
   LOGFILE="$INSTALLOG"
   createLogdirectory
   startLog