The network admin requires me to register my computer through this shell script. Anyways it worked fine for my slackware computer, but did not work properly on my ubuntu computer. I was wondering if you had any ideas on how to fix the script. If not, he should be back in on Monday so no big deal. Regardless I would still like to know why it worked on one distro and not the other...
Code:
#!/bin/sh
init_dir=`pwd`
mkdir .CSA.TEMP >/dev/null
\cd .CSA.TEMP
SKIP=`awk '/^__BEGIN_GZIP__/ { print NR +1; exit 0; }' $init_dir/$0`
tail -n +$SKIP $init_dir/$0 | gzip -dc | tar x
chmod +x ./engine
#LD_LIBRARY_PATH=.bncsa_deps:$LD_LIBRARY_PATH ./engine >/dev/null
#rm -r .bncsa_deps/
./engine >/dev/null
function doMoz
{
if mozilla -remote 'ping()';
then mozilla -remote "openFile(`pwd`/results.html)";
else mozilla file://`pwd`/results.html ;
fi;
}
function doNetscape
{
if netscape -remote 'ping()';
then netscape -remote "openFile(`pwd`/results.html)";
else netscape file://`pwd`/results.html;
fi;
}
function doFirefox
{
firefox file://`pwd`/results.html
}
function doEphy
{
epiphany file://`pwd`/results.html
}
function doKonq
{
konqueror `pwd`/results.html
}
function doSeamonkey
{
if seamonkey -remote 'ping()';
then
seamonkey -remote "openFile(`pwd`/results.html)";
else
seamonkey file://`pwd`/results.html;
fi;
}
function doOpera
{
opera -newwindow `pwd`/results.html
}
if [ -e `pwd`/results.html ]
then
doFirefox || doMoz || doNetscape || doOpera || doSeamonkey || doEphy || doKonq
else
echo "Error running CSA.sh. Please call the helpdesk."
fi
rm engine
rm agent.config
rm tmp.csa
\cd ..
rm $0
exit 0;
__BEGIN_GZIP__
After begin gzip it has a bunch if gibberish which I'm assuming is a binary file. The rest of the file is much too large to post here. The output after it unsuccessfully runs is:
Code:
tar: engine: time stamp 2008-04-12 16:53:41 is 12315.041953297 s in the future
tar: agent.config: time stamp 2008-04-12 16:53:41 is 12315.041090701 s in the future
tar: .bncsa_deps/libc.so: time stamp 2008-04-12 16:53:41 is 12315.040691551 s in the future
tar: .bncsa_deps/libc.a: time stamp 2008-04-12 16:53:41 is 12314.964283152 s in the future
tar: .bncsa_deps: time stamp 2008-04-12 16:53:41 is 12314.963950007 s in the future
./engine: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
./CSA.sh: 12: function: not found
./CSA.sh: 18: mozilla: not found
./CSA.sh: 18: mozilla: not found
./CSA.sh: 19: function: not found
./CSA.sh: 25: netscape: not found
./CSA.sh: 25: netscape: not found
./CSA.sh: 26: function: not found
It also opens up firefox to file:///tmp/.CSA.TEMP/results.html and returns a file not found message.