M
MaRiOs
Guest
I use the Event manager ,and
add an Event handler.
The hander is about Domain Creation
and it is supposed to create a folder .ssh every time a new domain is added.The command it runs is :
/usr/local/psa/bin/ssh.sh <new_domain_name>
the ssh.sh script contains :
#!/bin/bash
echo "--------------" >> /tmp/event_handler.log
/bin/date >> /tmp/event_handler.log
/usr/bin/id >> /tmp/event_handler.log
cd /home/httpd/vhosts/$1 >> /tmp/event_handler.log
pwd >> /tmp/event_handler.log
if [ ! -d .ssh ]; then mkdir .ssh ; chmod 700 .ssh ; fi >> /tmp/event_handler.log
#mkdir .ssh >> /tmp/event_handler.log
echo "domain: $1" >> /tmp/event_handler.log # domain name`cat authorized_keys`
echo "--------------" >> /tmp/event_handler.log
echo -e "Subject:New Domain Notification\nFrom:Server <[email protected]>\n"`cat /tmp/event_handler.log` | /usr/sbin/sendmail [email protected]
In the email i get result like :
Tue Aug 23 07:03:35 CEST 2005 uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) /root domain: sdgfadgfsadfgsdfgsd.gr --------------
the .ssh folder is not created in the target folder i wanted,so i gave the
pwd >> /tmp/event_handler.log in the script to see where it goes.
and it goes in the /root
I tried many things and i cant make it go to cd /home/httpd/vhosts/$1
any ideas ?
add an Event handler.
The hander is about Domain Creation
and it is supposed to create a folder .ssh every time a new domain is added.The command it runs is :
/usr/local/psa/bin/ssh.sh <new_domain_name>
the ssh.sh script contains :
#!/bin/bash
echo "--------------" >> /tmp/event_handler.log
/bin/date >> /tmp/event_handler.log
/usr/bin/id >> /tmp/event_handler.log
cd /home/httpd/vhosts/$1 >> /tmp/event_handler.log
pwd >> /tmp/event_handler.log
if [ ! -d .ssh ]; then mkdir .ssh ; chmod 700 .ssh ; fi >> /tmp/event_handler.log
#mkdir .ssh >> /tmp/event_handler.log
echo "domain: $1" >> /tmp/event_handler.log # domain name`cat authorized_keys`
echo "--------------" >> /tmp/event_handler.log
echo -e "Subject:New Domain Notification\nFrom:Server <[email protected]>\n"`cat /tmp/event_handler.log` | /usr/sbin/sendmail [email protected]
In the email i get result like :
Tue Aug 23 07:03:35 CEST 2005 uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel) /root domain: sdgfadgfsadfgsdfgsd.gr --------------
the .ssh folder is not created in the target folder i wanted,so i gave the
pwd >> /tmp/event_handler.log in the script to see where it goes.
and it goes in the /root
I tried many things and i cant make it go to cd /home/httpd/vhosts/$1
any ideas ?