Possible to make shell script to enter passwords, fdisk values etc for me?
Hi, I want to make a shell script to install Gentoo for me.
And I was wondering if it was possible to use it to fill out things like passwords, fdisk options etc,
eg:
passwd
mypass
mypass
fdisk /dev/sda
n
p
1
a
(return)
+32M
etc
Thanks
clicky
I dont think you can make it work with the default shell language though =(
You probably need to install something like empty to create the pseudo-terminal for you.
You can use the expect utility if it is installed on your system.
If not, perl is often installed as part of the base system on most distros, so you can try the perl expect module.
I dont think you can make it work with the default shell language though =(
You probably need to install something like empty to create the pseudo-terminal for you.
You can use the expect utility if it is installed on your system.
If not, perl is often installed as part of the base system on most distros, so you can try the perl expect module.
I found autoexpect to be very useful this past month. I had to configure almost 700 machines recently, and having to type in the passwords by hand, running a configuration menu, getting to the menu entries in question, and finally editing the value would have been tedious. I used autoexpect to watch what I did for one machine, then I just edited the resulting script so that it wouldn't choke on slight differences in output from each machine.
Managed to get through the 700 machines by running the command on a list of machine names and then getting myself something to eat. B-)
Managed to get through the 700 machines by running the command on a list of machine names and then getting myself something to eat. B-)
-------------------------GBGames' Blog: An Indie Game Developer's Somewhat Interesting ThoughtsStaff Reviewer for Game Tunnel
Thanks i'm trying them both now,
GBGames, did you just install autoexpect on each machine before you ran the script, or did you do it from the network?
GBGames, did you just install autoexpect on each machine before you ran the script, or did you do it from the network?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement