summaryrefslogtreecommitdiffstats
path: root/share/examples/diskless/HT.DISKLESS/rc.local
blob: f473d4152168a485edfd3567bcde739c85698cb2 (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
#!/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

OpenPOWER on IntegriCloud