Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > e5fadbd4d5f96be9f66974f825bc622c > files > 1

drakfirsttime-2.25.5-1mdv2010.1.noarch.rpm

#!/bin/sh
# to be sourced (so it blocks as long as firefox runs)
# (c) 2004 Mandrakesoft SA
# (c) 2006,2007 Mandriva SA

# this script runs a firefox instance with a specific profile
# and points it at register page

BROWSER=/usr/bin/display_help
[ -x $BROWSER ] || BROWSER=/usr/bin/mozilla-firefox

if [ -f /etc/sysconfig/firstboot -a -x $BROWSER ]; then
    . /etc/sysconfig/firstboot
    if [ "$FIRSTBOOT" = yes ]; then

        # run HCL collector for later upload:
        [ -x /usr/sbin/hclcollector ] && /usr/sbin/hclcollector&

        TMPUSER=ftw

        # after an install with main_language=english and more_languages=japanese,
        # uim will be launched by gtk, and uim will fail when HOME is unset
        # (which is the case with xdm and kdm, cf #24472)
        # This also fixes firefox startup:
        HOME2=/home/$TMPUSER

        /usr/sbin/useradd -r -m -s /bin/false -d $HOME2 -c "system user for drakfirsttime" $TMPUSER 

        # copy the X11 cookie so that we can connect to the X server:
        cp -a $XAUTHORITY $HOME2/.Xauthority
        chown -R $TMPUSER $HOME2

        # run the wizard as user:
        su ftw -m -c "USER=$TMPUSER GCONF_TMPDIR=$HOME2/tmp HOME=$HOME2 BROWSER=$BROWSER XAUTHORITY=$HOME2/.Xauthority /usr/bin/ftw-start-browser.sh"

        # ftw was done:
        echo "FIRSTBOOT=no" > /etc/sysconfig/firstboot

        # securize the system:
        userdel -r $TMPUSER
    fi
fi