LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-27-2006, 11:25 AM   #1
icetomyst
LQ Newbie
 
Registered: Jun 2006
Distribution: FC5
Posts: 14

Rep: Reputation: 0
Unhappy Problem w/ .sh script


im not too sure if this is the proper place for something like this but this site has helped me greatly in the past so i figured id give it a shot, quite frankly its my last hope

ok heres my problem, im running a CentOS linux game server, and its running a .sh script made to email admins of a problem people are having when someone issues the command !admin <message>, the script works and its all good.

Now, what im trying to do, is add onto that script so that it logs into an ICQ or AIM messenger account and IMs the <message> that was typed to a couple of my admins on ICQ or AIM. I've googled half the night and was unable to come up with anything useful...not to mention im a noob when it comes to .sh scripts. My biggest problem is that the script has to be contained in the one existing .sh file, i dont have the access to install anything like NET::AIM, NET::ICQ or gaim. The author of the script stated quite a few times on his website that he was able to add a few lines after the "mail" command to send messages via ICQ/AIM messengers, but never shared his additions to the origional script...i posted my problem there on his site about 3 months ago, but no one has seen or heard from the guy since december so im fairly certain my question will remain unanswered there.

I know its alot to ask of someone, but if ANYONE can come up with this it would be HUGELY appreciated. Heres the origional script called notify.sh:

Code:
#!/bin/sh


LOCKFILE=notify.lock
LOCKDIR=var
# LOCKDIR=/usr/local/games/enemy_territory/etadmin_mod/tools/locks

# Lock this script at least 30 minutes
LOCK=`find $LOCKDIR/ -cmin -30 -name $LOCKFILE`

if ( test -z "$LOCK" ) then
        # OK
        touch $LOCKDIR/$LOCKFILE
else
        # LOCKED
        echo "Admin already notified in the last 30 minutes."
        exit
fi

echo "Message from $2:" 		>$LOCKDIR/$LOCKFILE
echo "$3" 				>>$LOCKDIR/$LOCKFILE 
mail email@removed.com -s "FS Admin Notify" 	<$LOCKDIR/$LOCKFILE

echo "Thank you $1^0. ^7An Admin has been notified..."
As you can see its quite simple, when someone issues !admin <message> it dumps the message into a file called notify.lock, then emails the set email address with the contents of notify.lock with the subject "FS Admin Notify", then locks the script for 30 minutes.

If anyone can figure out something that i could throw in after
"mail email@removed.com -s "FS Admin Notify" <$LOCKDIR/$LOCKFILE"
that logs into AIM or ICQ (doesnt matter which) sends the message to 3 or 4 names if then disconnects, then you could be an absolute lifesaver and i would proclaim you as a genious. Thanks in advance to anyone whos knowledgable enough to take this on.

Last edited by icetomyst; 08-27-2006 at 11:32 AM.
 
Old 08-27-2006, 11:30 AM   #2
debiant
Member
 
Registered: Jul 2006
Distribution: Source Mage 0.9.6
Posts: 196

Rep: Reputation: 30
I'm thinking you might get more responses throwing this into the Programming forum here, I would ask a mod to move it for me.
 
Old 08-27-2006, 11:33 AM   #3
icetomyst
LQ Newbie
 
Registered: Jun 2006
Distribution: FC5
Posts: 14

Original Poster
Rep: Reputation: 0
ah, thanks, could a mod please move this to Programming
 
Old 08-27-2006, 03:32 PM   #4
timothyb89
Member
 
Registered: Jul 2006
Location: Colorado, USA
Distribution: openSuSE 11.4
Posts: 118

Rep: Reputation: 15
Try libmsn (I think.
It's a command line based MSN messenger. You can send a message with a script like this:
Code:
msn;
m <username> <message>;
 
Old 08-27-2006, 03:56 PM   #5
icetomyst
LQ Newbie
 
Registered: Jun 2006
Distribution: FC5
Posts: 14

Original Poster
Rep: Reputation: 0
just tried it, wont run, i cant install the libraries, i only have ftp access to that server, and i dont have root or ssh access AND my host wont install anything thats not already there...which is why i really needed it to be just a connect/send/disconnect sh script that i can add to my current sh script...thats why its so hard for me to figure out. I mean i know it can be done, the guy who wrote the script used the same server host I do, so he couldnt install anything extra either yet ive actually witnessed it working for him, and the only information he mentioned about it is that he just added to the script in notify.sh that i posted above, but unfortunately he fell off the planet. Thanks for the attempt tho timothy, much appreciated. Hopefully someone that has written something similar in the past will get around to readin this.

Last edited by icetomyst; 05-08-2008 at 03:32 AM.
 
Old 08-29-2006, 10:15 AM   #6
icetomyst
LQ Newbie
 
Registered: Jun 2006
Distribution: FC5
Posts: 14

Original Poster
Rep: Reputation: 0
soooo can i get a mod to put this in programming please?
 
Old 08-29-2006, 10:18 AM   #7
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Consider it moved to programming. In the future, click on the "report" link by your post and place it there: this will catch our attention and will end up with it being moved much sooner.
 
  


Reply

Tags
script, sh, shell


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
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
PPPD Script problem when cron-scheduling the script andresurzagasti Linux - Networking 0 11-24-2004 03:54 PM
Script file problem (or operator problem) HELP! lostone Programming 2 05-23-2001 03:30 PM
Script file problem (or operator problem) HELP! lostone Linux - General 1 05-17-2001 07:11 PM
Script file problem (or operator problem) HELP! lostone Linux - Newbie 0 05-15-2001 08:59 PM


All times are GMT -5. The time now is 07:23 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration