Subversion Repositories livecd

Rev

Rev 138 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 138 Rev 140
Line 252... Line 252...
252
    echo 0 > /proc/sys/kernel/printk
252
    echo 0 > /proc/sys/kernel/printk
253
    DEVICES=$( list_partition_devices )
253
    DEVICES=$( list_partition_devices )
254
    for DEVICE in $DEVICES; do
254
    for DEVICE in $DEVICES; do
255
        # try to mount the device and unmount it. 
255
        # try to mount the device and unmount it. 
256
        # If OK, we can add it to fstab
256
        # If OK, we can add it to fstab
257
	DEV=$( echo $DEVICE | cut -d"/" -f 3 )
257
	DEV=$( basename $DEVICE )
258
	if [ $DEV ]; then
-
 
259
	    mkdir -p /mnt/$DEV
258
	mkdir -p /mnt/$DEV
260
	    mount $DEVICE /mnt/$DEV >/dev/null 2>&1
259
	mount $DEVICE /mnt/$DEV >/dev/null 2>&1
261
	    # search for $SAVEFOLDER
260
	# search for $SAVEFOLDER
262
	    if [ -d /mnt/$DEV/$SAVEFOLDER ]; then
261
	if [ -d /mnt/$DEV/$SAVEFOLDER ]; then
263
		FOUND_RESTORE_DEV=/dev/$DEV
262
	    FOUND_RESTORE_DEV=/dev/$DEV
264
		echo "Found folder '$SAVEFOLDER' on $FOUND_RESTORE_DEV"
263
	    echo "Found folder '$SAVEFOLDER' on $FOUND_RESTORE_DEV"
265
	    fi
264
	fi
266
	    # unmount again
265
	# unmount again
267
	    umount /mnt/$DEV >/dev/null 2>&1
266
	umount /mnt/$DEV >/dev/null 2>&1
268
	    # if sucsessful add to fstab, if not already done
267
	# if sucsessful add to fstab, if not already in fstab
269
	    if [ "$?" = "0" ]; then
268
	if [ "$?" = "0" ]; then
270
		grep -q "^$DEVICE " /etc/fstab
269
	    grep -q "^$DEVICE " /etc/fstab
271
		if [ "$?" != "0" ]; then
270
	    if [ "$?" != "0" ]; then
272
		    echo -e "$DEVICE \t /mnt/$DEV \t auto \t $MOUNTOPT,suid,dev,exec 0 0" >> /etc/fstab
271
		echo -e "$DEVICE \t /mnt/$DEV \t auto \t $MOUNTOPT,suid,dev,exec 0 0" >> /etc/fstab
273
		fi
-
 
274
	    else
-
 
275
		rmdir /mnt/$DEV 2>/dev/null
-
 
276
	    fi
272
	    fi
-
 
273
	else
-
 
274
	    rmdir /mnt/$DEV 2>/dev/null
277
	fi
275
	fi
278
    done
276
    done
279
    # enable kernel messages again
277
    # enable kernel messages again
280
    echo 6 > /proc/sys/kernel/printk
278
    echo 6 > /proc/sys/kernel/printk
281
fi
279
fi