summaryrefslogtreecommitdiff
path: root/network/freenx/preinstall.sh
diff options
context:
space:
mode:
authorponce <matteo.bernardini@sns.it>2010-12-09 10:29:01 -0600
committerRobby Workman <rworkman@slackbuilds.org>2010-12-09 10:29:01 -0600
commitc8cbc6a05cd2c057761c473574aefff409751c4c (patch)
tree7d7e44b78e7c3d27d22f5e9eb5dd70de34583bd3 /network/freenx/preinstall.sh
parent8cb50d13eaa0a31273698f99bd5f668cb75edd66 (diff)
downloadslackbuilds-c8cbc6a05cd2c057761c473574aefff409751c4c.tar.gz
network/freenx: Added (Free implementation of the NX Server)
Thanks to Eric Hameleers (alienBOB) for the original script on which this one is based. Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'network/freenx/preinstall.sh')
-rw-r--r--network/freenx/preinstall.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/network/freenx/preinstall.sh b/network/freenx/preinstall.sh
new file mode 100644
index 0000000000..00287a7e2b
--- /dev/null
+++ b/network/freenx/preinstall.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/bash
+# freenx preinstall script
+# excerpted from alien bob's doinst.sh
+# mixed by ponce <matteo.bernardini@sns.it>
+
+set -e
+
+if ! /sbin/pidof sshd >/dev/null ; then
+ echo ""
+ echo "WARNING: The SSH daemon is not running, but without SSH, NX will not work."
+fi
+
+if ! which nc 1>/dev/null 2>/dev/null ; then
+ echo ""
+ echo "WARNING: FreeNX needs the 'netcat' program to be installed."
+fi
+
+if ! which expect 1>/dev/null 2>/dev/null ; then
+ echo ""
+ echo "WARNING: FreeNX needs the 'expect' program to be installed."
+fi
+
+# create the $HOME/.ssh directory for the nx user and give it 700 permission.
+mkdir -p /var/lib/nxserver/home/.ssh
+chmod 700 /var/lib/nxserver/home/.ssh
+
+# create the nx user and group
+groupadd -g 243 nx
+useradd -m -d /var/lib/nxserver/home -s /usr/bin/nxserver -u 243 -g 243 nx
+
+# assign the nx user a random password of 30 alphanumeric chars to avoid problems
+# with unlocking: http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:nx
+usermod -p $(echo $RANDOM$(date)$RANDOM | md5sum | cut -b 2-32) nx
+passwd -u nx 1>/dev/null
+
+echo "nx user/group added."