Use a shell script, something like:
Code:
#!/bin/bash
#
# This is a comment line. Describe what the script is doing in English here
#
command_1
command_2
command_3
# /mnt/directoy -A (popup, if correct then run) -- hmm, not sure what you mean here
command_4
command_5
# etc.
That should be about it. All you do is type in the command and it's parameters in the script. Each new line is a new command. Make sure that the first line in the text file is "#!/bin/bash" and that's it. Since this'll be a startup script, you won't need to
su to run a root-owned-and-operated command (as on startup, init has control of everything anyways). Test the script out as root and when it works to perfection, copy it over to the init scripts directory and then make a symbolic link:
Code:
# cp myscript.sh /etc/rc.d/init.d/myscript
# cd /etc/rc.d/rc3.d
# ln -s S99myscript ../init.d/myscript
or something like that. It really depends on your distribution. Then you'll have it run on startup.
Now, if you need this to run at log in, it'll be a bit different. You'll want to put the script somewhere in the user's home directory and then edit your .bashrc file and add
to it. Plus you'll need to put the "su" command in there. You'll have to interactively supply the password, as there's no easy way to have the script send the root password (plus, it's a really, really stupid idea to have a script execute commands as root. Major security risk).
One more thing, you'll have to
Code:
# chmod ug+x myscript.sh
in order for the script to work.
Hope that helps. Need more info, use
Google to find out more info on bash scripting.
-- the dUdeMan