It looks like the dialog to accept the login parameters is not reading from stdin, so no amount of stdio redirection is going to work. Another tack must be taken.
One method is to run the program inside of a gnu screen
session. Screen allows one to 'stuff' characters into its console/tty input at a bit lower level, so we can 'type' into things that aren't reading stdin.
# ========= rc.local ===========
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
# We run the client application inside of Gnu screen sessions, so
# we can monitor them and send commands to their interactive shells. We need
# a way to create a tty for them at boot time. The Xvfb provides a virtual X server
# to support an xterm that can in turn support a bash shell.
echo "Launching X virtual framebuffer"
Xvfb :1 -fbdir /tmp &
# We really should do something more robust for this...
echo "Snoozing while the virtual X server finds it's fonts..."
echo "Starting 24 Online xterm/screen"
xterm -e screen -S "$SCREEN_24ONLINE" bash &
# Q: So what is all this `echo -ne '\015'` stuff?
# A: We are stuffing characters into a Gnu screen session, and
# this is how we stuff a 'newline'
echo "Starting 24 Online"
screen -S "$SCREEN_24ONLINE" -X stuff "cd /dir/where/the/program/lives"`echo -ne '\015'`
screen -S "$SCREEN_24ONLINE" -X stuff "./24onlineClient -u $USER_24ONLINE"`echo -ne '\015'`
# Sleep a second while the program digests the entry... (may be required, or not)
screen -S "$SCREEN_24ONLINE" -X stuff "$PASSWORD_24ONLINE"`echo -ne '\015'`
# ======================== End 24 Online setup ============================
The above is a modification of a method I use for launching an application at boot time.
The session will run as root, since it is run from rc.local. You may be able to use 'su' to change the user id when launching either screen or your 24 Online client. In order to access the running session, you can re-attach to the screen session with
screen -S "24 Online" -x
or, if you aren't already root
screen -S "root/24 Online" -x
If you are not the original owner of the screen session (probably root), you will have to have set up screen in multiuser mode by adding a line
You can test things using a normal shell script, and once the wrinkles are ironed out, put it into rc.local
I suggest reading up on gnu screen, a priori
. Note also the inherent insecurity of embedding a password into a plaintext file. Caveat emptor
I told you this was a monumental hack, did I not?