egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Services Control

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Talustus
Voice


Joined: 28 Aug 2006
Posts: 5

PostPosted: Mon Jan 08, 2007 2:13 am    Post subject: Services Control Reply with quote

Hi @ all im not realy a coder but i need this i have writen a snippet but it didnt work whats wrong ? if Services are going down on one maschine i type !servcontrol and the bot will execute the command to start the services on the maschine but it says can not execute /home/test/sbnc/sbnc - permission denied so i would execute it as root

first snippet i have tested

Code:
bind pub - !servcontrol pub_servcontrol
proc pub_servcontrol {nick uhost hand chan arg} {
putchan $chan "\00312...\00304trying to Start Services on Remote maschine "
set serv "/home/test/services/services"
eval exec $serv
}
<<<<<< didnt work i get the error can not execute /home/... -permission denied >>>>>>>>>

second snippet

Code:
bind pub - !servcontrol pub_servcontrol
proc pub_servcontrol {nick uhost hand chan arg} {
putchan $chan "\00312...\00304trying to Start Services on Remote maschine "
set su "su root"
eval exec $su
set pw "pw here"
eval exec $pw
}
bind pub - !servstart pub_servstart
proc pub_servstart {nick uhost hand chan arg} {
exec "/home/test/services/services"
}

but it didnt work it means su: wrong password but the pw is corect
some ideas or is there a script thats looks every half hour
if Services are online {halt}
if Services are offline exec /home/test/services/services
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Wed Jan 10, 2007 12:20 pm    Post subject: Re: Services Control Reply with quote

Why are you trying to execute the password?
Talustus wrote:
Code:
set pw "pw here"
eval exec $pw

I imagine you want something like this (not tested):
Code:
bind pub n !test test
proc test args {
   if {[catch {
      set su [open "|su root -c /home/test/services/services" r+]
      putlog "SU(1): [read $su]"
      puts $su "rootpass";# CHANGE THIS
      putlog "SU(2): [read $su]"
      close $su
   } err]} {
      putlog $err
   }
}

...but having the root password in plain text in the script might not be such a bright idea. Rolling Eyes
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber