42 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| file=/tmp/mail_ip-up$$
 | |
| 
 | |
| admin_email=argus@oopen.de
 | |
| from_address=ip-up_anw-urban@oopen.de
 | |
| from_name="ip-up - ANW-URBAN"
 | |
| 
 | |
| echo "" > $file
 | |
| echo " ********************************************************" >> $file
 | |
| echo " *** This is an autogenerated mail from `hostname -f` ***" >> $file
 | |
| echo "" >> $file
 | |
| echo " I brought up the ppp-daemon with the following" >> $file
 | |
| echo -e " parameters:\n" >> $file
 | |
| echo -e "\tInterface name...............: $PPP_IFACE" >> $file
 | |
| echo -e "\tThe tty......................: $PPP_TTY" >> $file
 | |
| echo -e "\tThe link speed...............: $PPP_SPEED" >> $file
 | |
| echo -e "\tLocal IP number..............: $PPP_LOCAL" >> $file
 | |
| echo -e "\tPeer  IP number..............: $PPP_REMOTE" >> $file
 | |
| if [ "$USEPEERDNS" ] && [ "$DNS1" ] ; then
 | |
|    echo -e "\tNameserver 1.................: $DNS1" >> $file
 | |
|    if [ "$DNS2" ] ; then
 | |
|       echo -e "\tNameserver 2.................: $DNS2" >> $file
 | |
|    fi
 | |
| fi
 | |
| 
 | |
| 
 | |
| echo -e "\tOptional \"ipparam\" value.....: $PPP_IPPARAM" >> $file
 | |
| echo "" >> $file
 | |
| echo -e "\tDate.........................: `date +\"%d.%m.%Y\"`" >> $file
 | |
| echo -e "\tTime.........................: `date +\"%H:%M:%S\"`" >> $file
 | |
| echo "" >> $file
 | |
| echo " ********************************************************" >> $file
 | |
| 
 | |
| #/bin/echo -e "From:ip-up@`hostname -f`\nTo:${admin_email}\nSubject: $PPP_LOCAL\n`cat $file`" | /usr/sbin/sendmail $admin_email
 | |
| ## /bin/echo -e "From:ip-up@inferno.local\nSubject: $PPP_LOCAL\n`cat $file`" | /usr/sbin/sendmail ckubu@so36.net
 | |
| 
 | |
| /bin/echo -e "From:${from_name} <${from_address}>\nTo:${admin_email}\nSubject: $PPP_LOCAL\n`cat $file`" | /usr/sbin/sendmail $admin_email
 | |
| 
 | |
| rm -f $file
 | |
| 
 |