It looks like those are bash scripts so try something like be sure your mail binary path is correct it may be somewhere else other then /bin echo "/bin/mail -s connecting someone at somewhere.com" > /home/icecast/bin/source-start chmod 775 /home/icecast/bin/source-start you may have a chown permissions issue too if the user that runs icecast can't see the /home/icecast/bin/source-start do the same for the source-end script -winn On Wed, Jul 24, 2013 at 9:39 AM, Phil - w2lie <w2lie at w2lie.net> wrote:> ** > > That would be possible if you call out a script in the connect or > disconnect actions. > > > > I'm told that Icecast pushes the mount point as a variable, but I was > unable to find any documentation. Does Icecast push the mount point to the > on-connect and on-disconnect scripts as a variable? > > From the online docs: > > <mount> > > <on-connect>/home/icecast/bin/source-start</on-connect> > <on-disconnect>/home/icecast/bin/source-end</on-disconnect> > </mount> > > > > --- > Phil / w2liehttp://www.w2lie.net > > On 2013-07-24 12:33, Miguel s wrote: > > anyone knows if is possible to create an email alert to notify me when a > mount point is connecting and disconnecting? > > _______________________________________________ > Icecast mailing listIcecast at xiph.orghttp://lists.xiph.org/mailman/listinfo/icecast > > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast/attachments/20130724/e791ba77/attachment.htm
This is how I do it in <on-connect>, just reverse it for <on-disconnect>, it works pretty well: --- #!/bin/bash # THEDATE=$(date +%F-%H_%M) SUBJECT="Stream $1 started" EMAIL="myemail at mydomain.com" rm /tmp/emailmessage.txt EMAILMESSAGE="/tmp/emailmessage.txt" echo "Stream $1 connected to us on $THEDATE." > $EMAILMESSAGE # send an email using /bin/mail /usr/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE --- Cheers, Jordan On 07/24/2013 03:27 PM, Winn Johnston wrote:> It looks like those are bash scripts so try something like > > be sure your mail binary path is correct it may be somewhere else > other then /bin > echo "/bin/mail -s connecting someone at somewhere.com > <mailto:someone at somewhere.com>" > /home/icecast/bin/source-start > > chmod 775 /home/icecast/bin/source-start > > you may have a chown permissions issue too if the user that runs > icecast can't see the /home/icecast/bin/source-start > > do the same for the source-end script > > -winn > > > > On Wed, Jul 24, 2013 at 9:39 AM, Phil - w2lie <w2lie at w2lie.net > <mailto:w2lie at w2lie.net>> wrote: > > That would be possible if you call out a script in the connect or > disconnect actions. > > > > I'm told that Icecast pushes the mount point as a variable, but I > was unable to find any documentation. Does Icecast push the mount > point to the on-connect and on-disconnect scripts as a variable? > > From the online docs: > > <mount> > > <on-connect>/home/icecast/bin/source-start</on-connect> > <on-disconnect>/home/icecast/bin/source-end</on-disconnect> > </mount> > > > > --- > Phil / w2lie > http://www.w2lie.net > > On 2013-07-24 12:33, Miguel s wrote: > >> anyone knows if is possible to create an email alert to notify me >> when a mount point is connecting and disconnecting? >> >> _______________________________________________ >> Icecast mailing list >> Icecast at xiph.org <mailto:Icecast at xiph.org> >> http://lists.xiph.org/mailman/listinfo/icecast > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org <mailto:Icecast at xiph.org> > http://lists.xiph.org/mailman/listinfo/icecast > > > > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-- Jordan (PGP: 0xDA470FF8)
After all the discussion last week, I finally decided to put my own connect / disconnect scripts in on my server, as well as make some changes to the house keeping. I'm now running my icecast server under chown, and as a user (instead of nobody). Chown and the user seem to be functioning fine. But, for some reason, Icecast cannot find my connect & disconnect scripts, even though the exist. They are .sh scripts and have 755 permissions. Running the scripts directly from shell work fine. But Icecast will always spit out an error that it can't find the connect or disconnect script. I've even put the scripts in the chown root, but no luck there either. Can someone help me figure out why icecast can't find my scripts? SSH: root at xx [/home/<user>]# icecast -c /home/<user>/icecast/<config>.xml Changed root successfully to "/home/<user>/icecast". Changed groupid to 5##. Changed userid to 5##. error.log: [2013-08-01 20:51:10] WARN main/main YP server handling has been disabled [2013-08-01 20:51:16] EROR source/source_run_script Unable to run command connect.sh (No such file or directory) [2013-08-01 20:51:21] EROR source/source_run_script Unable to run command disconnect (No such file or directory) Thanks for the help Phil By The way, I've extended the bash file to include different e-mail addresses for different feeds. #!/bin/bash # # W2LIE Icecast Connect / Disconnect Parameters File # Use for notification system # # Rev .01 # # #Set the date and Time date="$(date '+%B %d,%Y')" time="$(date +%H%M)" # Set the Connect and Disconnect Subject Lines SUBJECT="Stream $1 connected" # Set our Delivery E-mail Addresses per feed if [[ $1 == "<feed a>" ]] || [[ $1 == "<feed b>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed c>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed d>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed e>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed f>" ]]; then email="email at address.tld email at address.tld email at address.tld" elif [[ $1 == "<feed g>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed h>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed i>" ]] || [[ $1 == "<feed j>" ]]; then email="email at address.tld email at address.tld" else email="email at address.tld" fi # Set the Connect and Disconnect Messages echo -e "Hello,\nThis is an automatic notification from W2LIE.net.\nThe ${1} Live Scanner Feed has connected to the server on ${date} at ${time}hrs.\n\nThank you,\nPhil / w2lie" > /home/<user>/icecast/scripts/${1}_connect.txt # send an email using /bin/mail /bin/mail -s "${SUBJECT}" ${email} < /home/<user>/icecast/scripts/${1}_connect.txt #EOF