LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-12-2008, 04:33 PM   #1
Ryzol
Member
 
Registered: Jun 2007
Distribution: Ubuntu, Slackware
Posts: 50

Rep: Reputation: 15
given a shell script to register computer, admin out for the weekend


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.
 
Old 04-13-2008, 02:26 AM   #2
thedonkdonk
Member
 
Registered: Oct 2005
Location: San Jose, CA
Distribution: Fedora, RHEL, CentOS
Posts: 136

Rep: Reputation: 16
I am not sure if this is specificly the problem but the default shell for Ubuntu is diffrent then Slackware. I would try running the program using the bash shell specificly. At the command line type:

Code:
bash ./CSA.sh
This will specificly invoke the bash shell to do the interpreting instead of the dash shell which is the default for Ubuntu. I hope this helps.
 
Old 05-13-2008, 12:55 PM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Ryzol,
Did that work?

Thanks, donkdonk, I didn't know that about Ubuntu.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to register auto start/stop service script with chkconfig travellers Linux - Software 8 06-15-2009 11:02 AM
Writing a bash script to find and register vmware vms juchestyle Programming 6 01-07-2007 12:03 PM
How much ram does my computer register....... thedu Linux - Newbie 4 07-30-2006 03:35 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
How to register a Tcl script as a service? vlbaranov Linux - Newbie 2 06-01-2004 10:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration