PDA

View Full Version : Mobile Terminal and bash autostart?


gamempire
08-14-2007, 04:42 PM
I must be missing something incredibly trivial, but I still haven't figured out a way to have Mobile Terminal launch bash when it starts up. Granted I'm using an older version, but still.

Anyone have any ideas on how to accomplish this, as its a major pain in the ass to type /bin/bash everytime when it boots up in sh and there is no god damm backspace :mad:

xorbital
08-14-2007, 05:10 PM
you need to set the shell preference for root in /etc/master.passwd and then make sure that login is in your /bin directory. once the terminal starts up it will use login to read roots sh preference and will start up bash. you can configure bash however you like by creating a ~/.profile file and adding aliases/exports/whatever to it.

hope that helps

phattie
08-14-2007, 06:01 PM
You will need to create a new file in /etc called shells. This will allow /bin/bash to be set as a shell. Mine looks like this:

iPhone:/var/root$ cat /etc/shells
# Begin Shells

/bin/sh
/bin/bash

# End Shells


Also, as previously mentioned, edit /etc/master.passwd so the last part of the line is changed from:

<blah>:/var/root:/bin/sh

to


<blah>:/var/root:/bin/bash


The bash profile is read from .bash_profile in your HOME, or /var/root/.bash_profile if unchanged.

Good luck!

gamempire
08-14-2007, 06:42 PM
Yeah, thats the stuff that I tried. Nothing seemed to work =(

I only changed the login shell for root, should I also change it for one of the other users?

gamempire
08-14-2007, 06:49 PM
Hmm, just figured out why. For some reason, a .bash_profile was never created, while a .bash_history was.

Kinda odd that it would happen like that, but I just created an empty .bash_profile in /var/root/ and now its working.

Thanks for reminding me to check the profile phattie :)

BenjaminD
08-15-2007, 01:42 AM
So that's how your supposed to do it. I replaced the sh binary with the bash binary. It worked fine, except it claimed to be sh instead of bash...

Thank you very much, now I can do it in a slightly more sane way!

Ben

dogzilla
08-15-2007, 04:53 AM
Actually, it turns out that the iPhone recognizes .shrc and .bashrc files as well. I've put aliases in there to make life easier - big help when typing characters is at a premium. Also, I wasn't sure if messing with the default shell would cause probs, so I put a simple command at the end of my .shrc that launches /bin/bash - makes it trivial to back out of.