[Debian-live-changes] r1461 - dists/trunk/live-initramfs/scripts/live-bottom

Daniel Baumann daniel at alioth.debian.org
Fri May 11 13:57:31 UTC 2007


Author: daniel
Date: 2007-05-11 13:57:31 +0000 (Fri, 11 May 2007)
New Revision: 1461

Modified:
   dists/trunk/live-initramfs/scripts/live-bottom/10adduser
Log:


Modified: dists/trunk/live-initramfs/scripts/live-bottom/10adduser
===================================================================
--- dists/trunk/live-initramfs/scripts/live-bottom/10adduser	2007-05-11 13:46:51 UTC (rev 1460)
+++ dists/trunk/live-initramfs/scripts/live-bottom/10adduser	2007-05-11 13:57:31 UTC (rev 1461)
@@ -65,45 +65,50 @@
 
 if [ -f /root/etc/sudoers ]
 then
-	if [ "${BUILD_SYSTEM}" = "Ubuntu" ]
-	then
-		grep -q '^%admin' /root/etc/sudoers && sed -i -e '/^%admin/s/ALL$/NOPASSWD: ALL/' /root/etc/sudoers || echo '%admin  ALL=(ALL) NOPASSWD: ALL' >> /root/etc/sudoers
+	case "${BUILD_SYSTEM}" in
+		Debian)
+			echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
 
-		for file in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop
-		do
-			if [ -f "/root/$file" ]
-			then
-				chroot /root install -D -o $USERNAME -g $USERNAME $file /home/$USERNAME/Desktop/$(basename "$file")
-				break
-			fi
-		done
-	else # We are in debian :-)
-		echo "${USERNAME}  ALL=(ALL) NOPASSWD: ALL" >> /root/etc/sudoers
-		chroot /root sudo -u "$USERNAME" sh -c "echo 'SU_TO_ROOT_SU=sudo' >>/home/$USERNAME/.su-to-rootrc"
-		chroot /root sudo -u "$USERNAME" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
-		chroot /root sudo -u "$USERNAME" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
+			chroot /root sudo -u "${USERNAME}" sh -c "echo 'SU_TO_ROOT_SU=sudo' >> /home/${USERNAME}/.su-to-rootrc"
 
-chroot /root sudo -u "$USERNAME" sh -c "umask 0077 && mkdir -p /home/$USERNAME/.kde/share/config && cat >/home/$USERNAME/.kde/share/config/kdesurc" << EOF
+			chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/sudo-mode true
+			chroot /root sudo -u "${USERNAME}" gconftool-2 -s -t bool /apps/gksu/display-no-pass-info false
+
+chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/config && cat > /home/${USERNAME}/.kde/share/config/kdesurc" << EOF
 [super-user-command]
 super-user-command=sudo
 EOF
 
-		if [ -f /root/usr/share/apps/konsole/sumc.desktop ]
-		then
-			chroot /root sudo -u "$USERNAME" sh -c "umask 0077 && mkdir -p /home/$USERNAME/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop >/home/$USERNAME/.kde/share/apps/konsole/sumc.desktop"
-		fi
+			if [ -f /root/usr/share/apps/konsole/sumc.desktop ]
+			then
+				chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo mc -c/' /usr/share/apps/konsole/sumc.desktop > /home/${USERNAME}/.kde/share/apps/konsole/sumc.desktop"
+			fi
 
-		if [ -f /root/usr/share/apps/konsole/su.desktop ]
-		then
-			chroot /root sudo -u "$USERNAME" sh -c "umask 0077 && mkdir -p /home/$USERNAME/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop >/home/$USERNAME/.kde/share/apps/konsole/su.desktop"
-		fi
-	fi
+			if [ -f /root/usr/share/apps/konsole/su.desktop ]
+			then
+				chroot /root sudo -u "${USERNAME}" sh -c "umask 0077 && mkdir -p /home/${USERNAME}/.kde/share/apps/konsole && sed -e's/Exec=su.*$/Exec=sudo -i/' /usr/share/apps/konsole/su.desktop > /home/${USERNAME}/.kde/share/apps/konsole/su.desktop"
+			fi
+			;;
+
+		Ubuntu)
+			grep -q '^%admin' /root/etc/sudoers && sed -i -e '/^%admin/s/ALL$/NOPASSWD: ALL/' /root/etc/sudoers || echo '%admin  ALL=(ALL) NOPASSWD: ALL' >> /root/etc/sudoers
+
+			for FILE in /usr/share/applications/ubiquity-gtkui.desktop /usr/share/applications/kde/ubiquity-kdeui.desktop
+			do
+				if [ -f /root/${FILE} ]
+				then
+					chroot /root install -D -o ${USERNAME} -g ${USERNAME} ${FILE} /home/${USERNAME}/Desktop/`basename ${FILE}`
+					break
+				fi
+			done
+			;;
+	esac
 fi
 
-if [ -L /root/home/$USERNAME/Examples ]
+if [ -L /root/home/${USERNAME}/Examples ]
 then
-	chroot /root install -o $USERNAME -g $USERNAME -d /home/$USERNAME/Desktop/
-	mv /root/home/$USERNAME/Examples /root/home/$USERNAME/Desktop/
+	chroot /root install -o ${USERNAME} -g ${USERNAME} -d /home/${USERNAME}/Desktop/
+	mv /root/home/${USERNAME}/Examples /root/home/${USERNAME}/Desktop/
 fi
 
 log_end_msg




More information about the Debian-live-changes mailing list