grml-reboot: detect virtual machines + assume noprompt for them, add imvirt to Depends
[grml-etc.git] / etc / init.d / grml-home
1 #!/bin/sh
2 # Filename:      grml-home
3 # Purpose:       copy skeleton files if not already present
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 # Latest change: Don Sep 28 16:36:03 CEST 2006 [mika]
8 ################################################################################
9
10 # user with UID 1000
11 fstabuser=$(getent passwd 1000 | cut -d: -f1)
12
13 if [ -r /etc/grml_cd ] ; then # run only in live modus
14   chown "${fstabuser}": /home/"$fstabuser" # this is important for the home=/dev/ice bootparam
15   su -s /bin/sh "$fstabuser" -c "rsync -Ha --ignore-existing /etc/skel/ /home/${fstabuser}/"
16   #  ^^^^^^^^^^
17   #  this is important to prevent startup of the zsh/newuser module
18 fi
19
20 ## END OF FILE #################################################################