# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
-# Latest change: Mon Sep 17 15:12:21 CEST 2007 [mika]
+# Latest change: Wed Sep 19 20:27:03 CEST 2007 [mika]
################################################################################
set -u
[ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
[ -n "$USERNAME" ] || USERNAME=grml
-$ROOTCMD addgroup --gid 1000 $USERNAME
-$ROOTCMD useradd -d /home/$USERNAME -m -s /bin/zsh -g 1000 $USERNAME
+if grep -q "$USERNAME:x:1000" $target/etc/group ; then
+ echo "group $USERNAME exists already, skipping"
+else
+ $ROOTCMD addgroup --gid 1000 $USERNAME
+fi
-sed -i 's/^root::/root:*:/' $target/etc/shadow
+if grep -q "$USERNAME:x:1000" $target/etc/passwd ; then
+ echo "user $USERNAME exists already, skipping"
+else
+ $ROOTCMD useradd -d /home/$USERNAME -m -s /bin/zsh -g 1000 $USERNAME
+fi
+
+sed -i 's/^root::/root:*:/' $target/etc/shadow
sed -i "s/^$USERNAME:!:/$USERNAME:*:/" $target/etc/shadow
$ROOTCMD chsh -s /bin/zsh root
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
-# Latest change: Sun Sep 16 23:00:35 CEST 2007 [mika]
+# Latest change: Wed Sep 19 20:13:01 CEST 2007 [mika]
################################################################################
set -u
set -e
-$ROOTCMD mv /etc/motd.dpkg-new /var/run/motd
+if [ -f $target/etc/motd.dpkg-new ] ; then
+ $ROOTCMD mv /etc/motd.dpkg-new /var/run/motd
+fi
## END OF FILE #################################################################
# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3
# Authors: (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Wed Sep 19 13:38:54 CEST 2007 [mika]
+# Latest change: Wed Sep 19 20:07:43 CEST 2007 [mika]
################################################################################
# misc stuff
if [ -x /usr/bin/update-pciids ] ; then
einfo "Updating PCI- and USB-ids"
- update-pciids
- update-usbids
+ update-pciids || echo "Warning: update-pciids was not successfull">&2
+ update-usbids || echo "Warning: update-usbids was not successfull">&2
eend $?
else
ewarn "update-pciids/update-usbids not installed" ; eend 0
if [ -x /usr/sbin/nessus-update-plugins ] ; then
einfo "Updating nessus-plugins"
- nessus-update-plugins
+ nessus-update-plugins || echo "Warning: nessus-update-plugins was not successfull">&2
eend $?
else
ewarn "nessus-update-plugins not installed" ; eend 0
[ -n "$CHROOT_TARGET" ] || CHROOT_TARGET="$TARGET/grml_chroot"
if [ -d "$CHROOT_TARGET" ] ; then
- echo " [x] $CHROOT_TARGET exists already, skipping the stage 'fai dirnstall'"
+ echo " [x] $CHROOT_TARGET exists already, skipping the stage 'fai dirinstall'"
else
mkdir -p "$CHROOT_TARGET" || bailout 5 "Problem with creating $CHROOT_TARGET for FAI"
if [ -n "${MIRROR_DIRECTORY}" ] ; then
umount $CHROOT_TARGET/proc 2>/dev/null || /bin/true
umount $CHROOT_TARGET/sys 2>/dev/null || /bin/true
[ -n "$MIRROR_DIRECTORY" ] && umount "${CHROOT_TARGET}/${MIRROR_DIRECTORY}"
- # notice: 'fai dirinstall' does not seem to exit appropriate ->
- if grep -q 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log || \
- grep -q 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log ; then
+
+ # notice: 'fai dirinstall' does not seem to exit appropriate, so:
+ ERROR=''
+ [ -r "/var/log/fai/dirinstall/$HOSTNAME/software.log" ] &&
+ grep -q 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log && ERROR=1
+
+ [ -r "/var/log/fai/dirinstall/$HOSTNAME/shell.log" ] &&
+ grep -q 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log && ERROR=2
+
+ if [ -n "$ERROR" ] ; then
echo " [!] There was an error during execution of stage 'fai dirinstall'"
- echo " Check out /var/log/fai/dirinstall/$HOSTNAME/... for details"
+ echo " Check out /var/log/fai/dirinstall/$HOSTNAME/... for details. [exit ${ERROR}]"
exit 1
else
echo " [*] Finished execution of stage 'fai dirinstall'"