PDA

View Full Version : Script to mount iso and execute game


HeavyAl
December 1st, 2006, 06:39 PM
Hey All,

I tried to write a script that allows me to mount my starcraft iso, then run starcraft (via wine) and then unmount it all without having to type it in every time but the problem is that starcraft starts to kick off before I get asked for the password to mount the iso thus causing it to fail with the 'cannot find cd' dialog.

Heres what I've got:


#!/bin/bash
gksudo mount "/home/me/.wine/drive_c/Program Files/Starcraft/BROODWAR.iso" /media/fakedrv -o loop
wine "/home/me/.wine/drive_c/Program Files/Starcraft/starcraft.exe"
gksudo umount /media/fakedrv


So what am I missing? Do I need to delay it somehow? Does it require some stop parameter to tell it to wait for the result of gksudo before going to the program?

Thanks for any help!

KingBahamut
December 1st, 2006, 06:41 PM
mount command is wrong I think

mount -o loop,ro -t iso9660 install-x86-minimal-2006.0.iso /mnt/cdrom/

You have to specify type.

HeavyAl
December 1st, 2006, 07:03 PM
Thanks for the response but no, that command works fine from the cl. iso9660 doesn't have to be specified, mount just tries all the loop devices supported by the system when you use -o loop.

I'm sure there is some way of stopping the script after each part is executed but I haven't been able to locate it yet.

Ptero-4
December 1st, 2006, 07:14 PM
use the "sleep" command to delay execution in a script. Read it's manpage to see how it works.

HeavyAl
December 1st, 2006, 07:17 PM
Hahaha! Got it .. turns out it was gksudo that was the problem. I left the quotes off the command that needed executed. Noob error.
Thanks for the tidbit about fs type though, for some reason I forgot to even check before I posted what the actual terminal output was or I would have found this myself. Checking the fs type made me realize where the problem was occurring.

Thanks!