Register
It is currently Wed Apr 16, 2014 4:40 am

any ideas.........


All times are UTC - 6 hours


Post new topic Reply to topic  [ 10 posts ] 
Author Message
 PostPosted: Fri Oct 14, 2005 9:39 am   

Joined: Fri Oct 14, 2005 9:30 am
Posts: 61
http://www.freewebs.com/robnewland/doom3
hello i have posted this script on usalug already as you might have known
but i need a bit of help in perfecting it...
what it does is copies all the .pk4 files off your doom3 cds into the appropriate folder then downloads and runs the doom3 linux graphical installer.
The only problem with it is that when you insert the cd and the script tries to "cd" to the appropriate directory it often says it can't find the cd...
is there a way round this problem or is it simply a problem with my cds....


Top
 Profile WWW  
 PostPosted: Fri Oct 14, 2005 5:04 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
are you mounting the drive once the cd is inserted?
like... before you cd to the directory are you sure it is mounted?


Top
 Profile  
 PostPosted: Fri Oct 14, 2005 6:49 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 657
Location: Des Moines, Iowa
yep....... seems like that was an issue when i was installing UT ....... had to make sure the cd was mounted ;)


Top
 Profile WWW  
 PostPosted: Sat Oct 15, 2005 12:48 am   

Joined: Fri Oct 14, 2005 9:30 am
Posts: 61
how do i mount the cdrom in a bash script?


Top
 Profile WWW  
 PostPosted: Sat Oct 15, 2005 10:39 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
you mount a cdrom in bash the same way you mount it on the command line... everything you do in a script you can do from a command line and visa versa...
right before you cd to the directory
to
Code:
mount <device> <directory>
sleep .5

ofcourse you have to fill in the device and directory fields on that
and the sleep .5 makes sure that the drive is mounted before you continue
:)


Top
 Profile  
 PostPosted: Sun Oct 16, 2005 11:50 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
just a couple things :)
Quote:
#configure this bit #
user="rob" #
cdlocation="/mnt/cdrom" #
#end of config section #

now... if you are using the user that is running the script...
bash has it's own variable you can use for that...
$USER
in your console do:
Code:
echo $USER

as far as where the cdrom is located... i would have the user fill that on the fly
especially if it's not mounted yet...


Top
 Profile  
 PostPosted: Mon Oct 17, 2005 10:23 am   

Joined: Fri Oct 14, 2005 9:30 am
Posts: 61
I think I have it sorted :D
Code:
#!/bin/sh
###########################################
#This script was written by rob newland   #
#and is free (as in speech) for all uses. #
#it may be modified or have anything done #
#to it as long as this notice remains.    #
# Contact: robnewland@gmail.com           #
# Or : Find me on USALUG.org :D under     #
#the username crudball.                   #
###########################################   
######################################
#                                    #
#configure this bit                  #
user="rob"                           #
cdlocation="/mnt/cdrom"              #
#end of config section               #
#                                    #
######################################
echo
echo hello $user, welcome to my doom3 installation script for linux....
echo "
    ______________________    ____      ______
   /  _  / _   / _   /    \  /    \    |____  |
  / /_/ / |_| / |_| /  /\  \/  /\  \    ___|  |
/_____/_____/_____/__/  \____/  \__\  |___|  |
                                        ___|  |
    Press enter to start               |______| "
read -p "" pie
echo making appropriate directories...
cd /home/$user/
mkdir doom3 && cd doom3 && mkdir base && cd base
echo please insert your doom 3 cd1
eject $cdlocation
read -p "Press enter when ready..." pie
echo going into the doom3 cd1 files directory....
mount $cdlocation
sleep .5
cd $cdlocation/Setup/Data/base
echo copying the pk4 files
cp game00.pk4 /home/$user/doom3/base
cd $cdlocation/Setup/Data/base
cp pak002.pk4 /home/$user/doom3/base
echo finshed
echo please eject cd1 and insert cd2
read -p "Press enter when ready..." pie
echo going into doom3 cd directory
mount $cdlocation
sleep .5
cd $cdlocation/Setup/Data/base
echo copying the .pk4 files...
cp pak000.pk4 /home/$user/doom3/base
cd $cdlocation/Setup/Data/base
cp pak001.pk4 /home/$user/doom3/base/
echo please eject cd2 and insert cd3
read -p "Press enter when ready..." pie
echo changing directory to the doom3 cd
mount $cdlocation
sleep .5
cd $cdlocation/Setup/Data/base/
echo copying the .pk4 files
cp pak003.pk4 /home/$user/doom3/base/
cd $cdlocation/Setup/Data/base
cp pak004.pk4 /home/$user/doom3/base/
echo ok ejecting cd3
eject $cdlocation
echo downloading the appropriate .run installer from the internet
cd /home/$user/doom3
wget http://www.freewebs.com/doom3onlinux/doom3-linux-1.3.1302.x86.run
echo ...ok now launching setup,bye bye $user...
sh doom3-linux-1.3.1302.x86.run

eveything seems to work fine :D


Top
 Profile WWW  
 PostPosted: Mon Oct 17, 2005 8:10 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
that's good... i was thinking you would have to unmount the drive first... it's interesting it unmounts on its own apparently

nice changes though :)


Top
 Profile  
 PostPosted: Tue Oct 18, 2005 9:33 am   

Joined: Fri Oct 14, 2005 9:30 am
Posts: 61
couldn't have done it without you jbsnake :D


Top
 Profile WWW  
 PostPosted: Tue Oct 18, 2005 9:37 am   

Joined: Fri Oct 14, 2005 9:30 am
Posts: 61
also...
Coud you put my script in your downloads section?
http://www.freewebs.com/robnewland/doom3fix


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP