-
Notifications
You must be signed in to change notification settings - Fork 9
/
biolinuxfirstboot
executable file
·68 lines (54 loc) · 2.51 KB
/
biolinuxfirstboot
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
#!/bin/bash
# Author: Stewart Houten <[email protected]>
# Tim Booth <[email protected]>
# Date: Modified for BL7 Oct 2012
# for BL8 Jun 2014
# This script sets up a few customizations particular to Bio-Linux
# that can't be put into packages. On first boot (after
# installation) this script should execute once and then delete itself,
# or at least unhook itself from /etc/rc?.d. Maybe there is a way to
# make this a post-install hook for Ubiquity??
# This line is dynamic (generated by the build script) so it may change
# after the date at the top of the file.
# Erm - the file should be there already, right?
[ -e /etc/bio-linux.version ] || echo "0.0.0" > /etc/bio-linux.version
# Convince me that this script actually ran this time.
#date > /var/log/bio-linux-firstboot.timestamp
# The BL repo should now be safe from clobbering.
#stuff removed
# If this is the live CD then do no more. The most obvious way to check is to see if
# /rofs exists (mount point for squashfs).
if [ -e /rofs ] ; then
# Actually I lied about not doing more - fudge the locale
# I'm not 100% sure this is needed, but the whole language selection
# is a bit of a mystery. See also the settings in /etc/default/keyboard
if [ "$LANG" = "en_US.UTF-8" ] ; then
/usr/sbin/locale-gen "en_GB.UTF-8"
/usr/sbin/update-locale LANG="en_GB.UTF-8"
sed -i -e 's/^LANG=.*/LANG=en_GB.UTF-8/' /etc/environment
fi
exit 0
fi
# set up the main postgres database cluster, as this is disabled on the
# live system
pg_version=`ls /etc/postgresql | sort -n | tail -n1`
pg_createcluster --start "$pg_version" main
# MySQL is no longer on the system by default, so we get rid of
# this...
# mysql_install_db
# /etc/init.d/mysql start || true
# Cause exim to reconfigure non-interactively
dpkg-reconfigure -pcritical exim4-config
# Cause logcheck mails to go to the admin user (admins probably want these going to an external
# address, which can be done directly in /etc/logcheck/logcheck.conf)
admin_user=`cat /etc/group | grep ^admin | cut -d ':' -f 4 | cut -f 1 -d ','`
sed -i -e "s/^security:.*/security: ${admin_user}/" /etc/aliases
sed -i -e "s/^logcheck:.*/logcheck: ${admin_user}/" /etc/aliases
# Put the initial user into the arb group, if it exists
usermod -aG arb "$admin_user" >/dev/null 2>&1
# Regenerate ssh keys and start ssh. Note that for the sake of Packer
# this should be after any other dpkg-related stuff.
rm -f /etc/ssh/sshd_not_to_be_run
dpkg-reconfigure -pcritical openssh-server
# self-destruct
rm -f /etc/rc*.d/S??biolinuxfirstboot