Nicer rc scripts

Stefan Sperling stsp at stsp.in-berlin.de
Sun Apr 8 15:01:38 CEST 2007


On Sun, Apr 08, 2007 at 01:03:53PM +0100, Benjamin Tomos Lewis wrote:
> -# create /etc/passwd if it doesn't exist
> +# Create /etc/passwd if needed
>  if [ ! -f /etc/passwd ]
>  then
> -	echo "Creating default /etc/passwd"
> -	echo "root:xxSVJVBe8UDn2:0:0:Guybrush:/home:/bin/sh" > /etc/passwd
> -	echo "bin:x:1:1:bin:/bin:" >> /etc/passwd
> -	echo "daemon:x:2:2:daemon:/sbin:" >> /etc/passwd
> -	echo "nobody:x:99:99:Nobody:/:" >> /etc/passwd
> +        echo "Creating default /etc/passwd..."
> +        echo "root:xxSVJVBe8UDn2:0:0:Guybrush:/home:/bin/sh" > /etc/passwd
> +        echo "bin:x:1:1:bin:/bin:" >> /etc/passwd
> +        echo "daemon:x:2:2:daemon:/sbin:" >> /etc/passwd
> +        echo "nobody:x:99:99:Nobody:/:" >> /etc/passwd
> +	rchelper 0

Whitespace changes like these just increase the diff for no reason.
Please make sure to use tabs indents everywhere in these
scripts, not spaces. That will fix it.

> +echo "Mounting /media..."
> +echo " Trying vfat on SD card..." 
> +mount -t vfat -o noatime /dev/mmcblk1 /media & rchelper $?

That won't work, & is wrong. Use && :

  mount -t vfat -o noatime /dev/mmcblk1 /media && rchelper $?


Looks great otherwise, thanks!

-- 
stefan
http://stsp.in-berlin.de                                 PGP Key: 0xF59D25F0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mailman.dslinux.in-berlin.de/pipermail/dslinux-devel-dslinux.in-berlin.de/attachments/20070408/ba9563d9/attachment.pgp 


More information about the dslinux-devel mailing list