6394ad2fbb00c79135afab20408bd9e4e398a466
[automated-distro-installer] / fai / config / scripts / FAIBASE / 10-misc
1 #! /bin/bash
2
3 # (c) Thomas Lange, 2001-2012, lange@debian.org
4
5 error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
6
7 echo $TIMEZONE > $target/etc/timezone
8 cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime
9
10 if [ -n "$IPADDR" ]; then
11 ifclass DHCPC || ainsl -s /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME"
12 else
13 ifclass DHCPC && ainsl -s /etc/hosts "127.0.0.1 $HOSTNAME"
14 fi
15
16 fcopy -iM /etc/hosts /etc/motd
17
18 # make /root accessible only by root
19 chmod -c 0700 $target/root
20 chown -c root:root $target/root
21 # copy default dotfiles for root account
22 fcopy -ir /root
23
24 chmod -c 1777 ${target}/tmp
25 chown -c 0:0 ${target}/tmp
26
27 exit $error