Subversion Repositories livecd

Rev

Rev 86 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 86 Rev 87
Line 547... Line 547...
547
    cp -a /usr/share/applications/kde/krandrtray.desktop /home/${LOCALUSER}/.kde/Autostart 2>/dev/null
547
    cp -a /usr/share/applications/kde/krandrtray.desktop /home/${LOCALUSER}/.kde/Autostart 2>/dev/null
548
    cp -a /usr/share/applications/kde/kmix.desktop /home/${LOCALUSER}/.kde/Autostart 2>/dev/null
548
    cp -a /usr/share/applications/kde/kmix.desktop /home/${LOCALUSER}/.kde/Autostart 2>/dev/null
549
    chown -R ${LOCALUSER}.${LOCALUSER} /home/${LOCALUSER}/.kde/Autostart
549
    chown -R ${LOCALUSER}.${LOCALUSER} /home/${LOCALUSER}/.kde/Autostart
550
fi
550
fi
551
 
551
 
-
 
552
 
-
 
553
### first set empty password
-
 
554
if [ ! $NOROOT ]; then
-
 
555
    sed -i "s|^root:.*|root::12345:0:99999:1:::|" /etc/shadow
-
 
556
fi
-
 
557
if [ ! $NOLOCAL]; then
-
 
558
    sed -i "s|^$LOCALUSER:.*|$LOCALUSER::12345:0:99999:1:::|" /etc/shadow
-
 
559
fi
-
 
560
 
552
### set password for root and local user
561
### set password for root and local user
553
if [ ! $NOPASSWD ]; then
562
if [ ! $NOPASSWD ]; then
554
    if [ ! $NOROOT ] || [ ! $NOLOCAL ]; then
563
    if [ ! $NOROOT ] || [ ! $NOLOCAL ]; then
555
	echo -n "Set password for "
564
	echo -n "Set password for "
556
	if [ ! $NOROOT ]; then
565
	if [ ! $NOROOT ]; then
Line 561... Line 570...
561
	fi
570
	fi
562
	if [ ! $NOLOCAL ]; then
571
	if [ ! $NOLOCAL ]; then
563
	    echo -n "local user '$user' "
572
	    echo -n "local user '$user' "
564
	fi
573
	fi
565
	echo
574
	echo
-
 
575
	echo "or hit return for no password."
566
 
576
 
567
	if [ ! $NOLOCAL ]; then
577
	if [ ! $NOLOCAL ]; then
568
	    echo "Login as local user '$user' with this password."
578
	    echo "Login as local user '$user' with this password."
569
	    echo
-
 
570
	fi
579
	fi
-
 
580
	echo
571
 
581
 
572
        # set password, if not yet given by $PASSWD
582
        # ask for password, if not yet given by $PASSWD
-
 
583
	if [ ! $PASSWD ]; then 
573
	echo -n "Password: "
584
	    echo -n "Password: "
574
	read -s PASSWD
585
	    read -s PASSWD
575
	echo
586
	    echo
-
 
587
	fi
576
 
588
 
577
	# set password, if not empty
589
	# set password - or - set empty password
578
	if [ ! $NOROOT ] && [ "$PASSWD" ]; then
590
	if [ ! $NOROOT ] && [ "$PASSWD" ]; then
579
	    echo $PASSWD | passwd --stdin root >/dev/null
591
	    echo $PASSWD | passwd --stdin root >/dev/null
580
	fi
592
	fi
581
	if [ ! $NOLOCAL] && [ "$PASSWD" ]; then
593
	if [ ! $NOLOCAL] && [ "$PASSWD" ]; then
582
	    echo $PASSWD | passwd --stdin $user >/dev/null
594
	    echo $PASSWD | passwd --stdin $user >/dev/null
583
	fi
595
	fi
584
	echo
596
	echo
585
    fi
597
    fi
586
 
-
 
587
else
-
 
588
    # set root and $LOCALUSER to empty password
-
 
589
    sed -i "s|^root:.*|root::12345:0:99999:1:::|" /etc/shadow
-
 
590
    sed -i "s|^$LOCALUSER:.*|$LOCALUSER::12345:0:99999:1:::|" /etc/shadow
-
 
591
fi
598
fi
592
 
599
 
593
### try to get hostname from DNS, if not yet defined
600
### try to get hostname from DNS, if not yet defined
594
if [ ! $HOSTNAME ]; then
601
if [ ! $HOSTNAME ]; then
595
    echo "Try to get hostname from DNS ..."
602
    echo "Try to get hostname from DNS ..."