summaryrefslogtreecommitdiff
path: root/share/examples/diskless/HT.DISKLESS/rc.local
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>1999-02-10 14:25:04 +0000
committercvs2svn <cvs2svn@FreeBSD.org>1999-02-10 14:25:04 +0000
commit02fa10fea3a264a1dbe06c8bdfc4ad496a8c240f (patch)
tree27decf64ded75c84603f587ad4a7a4badbb6824d /share/examples/diskless/HT.DISKLESS/rc.local
parent0e596180fee10fc06e636b3506ccffc29d24027a (diff)
Notes
Diffstat (limited to 'share/examples/diskless/HT.DISKLESS/rc.local')
-rwxr-xr-xshare/examples/diskless/HT.DISKLESS/rc.local77
1 files changed, 77 insertions, 0 deletions
diff --git a/share/examples/diskless/HT.DISKLESS/rc.local b/share/examples/diskless/HT.DISKLESS/rc.local
new file mode 100755
index 000000000000..f473d4152168
--- /dev/null
+++ b/share/examples/diskless/HT.DISKLESS/rc.local
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+if [ -f /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+
+# Firewall helper - if we configure the firewall to let through
+# ports > 4000, we need to configure the machines as such.
+#
+
+sysctl -w net.inet.ip.portrange.first=4000
+
+# Setup spool
+#
+
+cat >> /var/spool/lpd/ljet4.ps << EOF
+#!/bin/sh
+#
+
+gs -q -dSAFER -dNOPAUSE -sDEVICE=ljet4 -r600x600 -dBitsPerPixel=1 \
+ -sOutputFile=- -
+EOF
+
+chmod 755 /var/spool/lpd/ljet4.ps
+
+mkdir /var/spool/ljet4
+chown daemon /var/spool/ljet4
+
+# Setup remote source
+#
+
+mount_mfs -s 600000 -T qp120at dummy /src
+mount apollo:/FreeBSD /FreeBSD
+mkdir /src/u3
+mkdir /src/u3/usr.obj
+
+# Copy of ssh_host_key* files to where sshd
+# expects them, assuming you add to /usr/local/etc/sshd_config:
+#
+# HostKey /var/db/ssh_host_key
+#
+# Then restart sshd ( the /usr/local/etc/rc.d script installed by
+# the port probably failed due to the lack of host keys )
+
+if [ -f /conf/ME/ssh_host_key ]; then
+ cp /conf/ME/ssh_host_key* /var/db
+else
+ (cd /var/db; ssh-keygen -f ssh_host_key -P "")
+fi
+chmod 400 /var/db/ssh_host_key
+chmod 644 /var/db/ssh_host_key.pub
+/usr/local/sbin/sshd
+
+# Copy home directory so you can login
+#
+#
+
+mount_mfs -s 65536 -T qp120at dummy /home
+
+if [ -d /home.diskless ]; then
+ cd /home.diskless
+ for i in *; do
+ if [ -f $i/home.tgz ]; then
+ mkdir /home/$i
+ chown $i /home/$i
+ chmod 700 /home/$i
+ (cd /home/$i; tar xzpf /home.diskless/$i/home.tgz)
+ homeok=1
+ fi
+ done
+fi
+
+if [ "${homeok:=0}" = "0" ]; then
+ echo "ERROR, NO /home.diskless DIRECTORY TO COPY TO /HOME"
+ sleep 10
+fi
+