diff options
Diffstat (limited to 'fai/config/scripts/FAIBASE/10-misc')
| -rwxr-xr-x | fai/config/scripts/FAIBASE/10-misc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/fai/config/scripts/FAIBASE/10-misc b/fai/config/scripts/FAIBASE/10-misc new file mode 100755 index 0000000..fbf85c1 --- /dev/null +++ b/fai/config/scripts/FAIBASE/10-misc @@ -0,0 +1,36 @@ +#! /bin/bash + +# (c) Thomas Lange, 2001-2012, lange@debian.org + +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code + +echo $TIMEZONE > $target/etc/timezone +if [ -L $target/etc/localtime ]; then + ln -sf /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime +else + cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime +fi + +if [ -n "$IPADDR" ]; then + ifclass DHCPC || ainsl -s /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME" +else + ifclass DHCPC && ainsl -s /etc/hosts "127.0.0.1 $HOSTNAME" +fi + +if [ -f $target/etc/hosts.orig ]; then + mv $target/etc/hosts.orig $target/etc/hosts +fi +fcopy -iM /etc/hosts /etc/motd + +# make /root accessible only by root +chmod -c 0700 $target/root +chown -c root:root $target/root +# copy default dotfiles for root account +fcopy -ir /root + +# use tmpfs for /tmp +ainsl /etc/fstab "tmpfs /tmp tmpfs nodev,nosuid,size=50%,mode=1777 0 0" +chmod -c 1777 ${target}/tmp +chown -c 0:0 ${target}/tmp + +exit $error |
