restore default ip configuration (2)
[debian6500.git] / trc6500-master-file / postinst
CommitLineData
e043b5aa
OL
1#!/bin/bash
2
3# since equivs can't handle symlinks, here we are doing them by hand. As of writing this script (2015-05-29), there are 11 symlinks to take care of.
4
5# I don't know why things were that way before, but I'm told to set them that way again.
6echo 'Moving things around..'
f12c94c8 7[ -h /home ] || mv /home /var/media/backup
e043b5aa 8mkdir -p /var/media/backup/dump/{core,dump_delay_line,dump_track_base,log,prod,rec,trace}
f12c94c8
LM
9ln -sf /var/media/backup/dump /
10ln -sf /var/media/backup/home /
11ln -sf /var/media/backup/rec /
12ln -sf /var/media/prod /var/media/backup/
13ln -sf /etc/hosts.30MHzMDF /etc/hosts.30MHz
14ln -sf /etc/hosts.8MHzMHF /etc/hosts.8MHz
15ln -sf /usr/lib/syslinux/menu.c32 /opt/tftp/menu.c32
16ln -sf /initrd.img /opt/tftp/initrd.img
17ln -sf /vmlinuz /opt/tftp/vmlinuz
18ln -sf /usr/lib/syslinux/pxelinux.0 /opt/tftp/pxelinux.0
19ln -sf /usr/lib/syslinux/memdisk /opt/tftp/memdisk
e043b5aa
OL
20echo 'Things moved.'
21
22# now enable all the scripts and such..
23echo 'Enabling on-startup scripts..'
24update-rc.d waitswitches defaults
25update-rc.d waitswitches enable
26update-rc.d etherwake defaults
27update-rc.d etherwake enable
28update-rc.d ipmiwake defaults
29update-rc.d ipmiwake enable
30update-rc.d wakeonlan defaults
31update-rc.d wakeonlan enable
32update-rc.d waitslaves defaults
33update-rc.d shutdownallblades defaults
34update-rc.d checkudevrules enable
35update-rc.d checkudevrules defaults
36echo 'Scripts enabled.'
37
38# and these other things too
39echo 'Finalizing configuration..'
a5773812 40chown webconfig /etc/webconfig/alias.d/50-trc6500-master-file.csv /etc/dhcp/dhcpd.conf*
e043b5aa
OL
41cp /etc/dhcp/dhcpd.conf.blank /etc/dhcp/dhcpd.conf
42chsh -s /usr/bin/pdmenu trc6500
43
44# from that sync_master.sh script.. Apparently there from Git shenanigans.
45chmod go-rwx /root/.ssh/id_rsa
46chmod go-rwx /opt/cluster/slave/root/.ssh
47chmod go-rwx /opt/cluster/slave/root/.ssh/id_rsa
48chmod a+rwx /opt/tftp
49
50echo "">/var/log/atftpd.log
51chown nobody /var/log/atftpd.log
52
8c20b58f
LM
53# solve an issue with old trc6500-webconfig
54touch /var/cache/webconfig/snmp.tree
55chown webconfig: /var/cache/webconfig/snmp.tree
56
e043b5aa
OL
57update-initramfs -u
58
59cd /opt/cluster
60# now this file is locked away during install and replaced by a dummy. So we put a duplicate of this in a script executed on first boot after the install.
61# this is still here because it is planned we install/update this on established systems
62[ -f /sbin/start-stop-daemon.REAL ] || make all
63echo 'Finalized.'
64
65