设为首页
收藏本站
用户名
Email
自动登录
找回密码
密码
登录
注册
快捷导航
平台
Portal
论坛
BBS
文库
项目
群组
Group
我的博客
Space
搜索
搜索
热搜:
shell
linux
mysql
本版
用户
LinuxSir.cn,穿越时空的Linuxsir!
»
论坛
›
Linux 综合讨论区 —— LinuxSir.cn
›
shell进阶应用、shell编程
›
IP变了之后自动发送邮件
返回列表
查看:
1298
|
回复:
1
IP变了之后自动发送邮件
[复制链接]
Yuri
Yuri
当前离线
积分
3231
IP卡
狗仔卡
发表于 2005-5-10 17:27:39
|
显示全部楼层
|
阅读模式
#cat /bin/newip.sh
[php]
newip=[`ifconfig ppp0 | grep inet | cut -d : -f 2 | cut -d " " -f 1`]
mail $USER<<EFO
you new ip is
newip
EFO
[/php]
添加/etc/ppp/ip-up中,但要在exit 0前,
这样IP变了之后就会自动发送邮件了。
但是我不知道如何发送到我的163邮箱里!
那位兄弟指点一下
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
显身卡
aaccdd
aaccdd
当前离线
积分
3346
IP卡
狗仔卡
发表于 2005-5-10 21:30:25
|
显示全部楼层
#!/bin/sh
newip=[`ifconfig ppp0 | grep inet | cut -d : -f 2 | cut -d " " -f 1`]
mail -s newip [email]email@163.com[/email] <<EFO
you new ip is:$newip
EFO
复制代码
回复
支持
反对
使用道具
举报
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
Mandriva Linux
Linux 输入开发与研究
Archlinux讨论区
服务器架设、应用、维护
BSD 讨论专题
SuSE Linux
Debian Linux
Ubuntu Linux 专题讨论
硬件设备 Linux 驱动
Copyright © 2002-2023
LinuxSir.cn
(http://www.linuxsir.cn/) 版权所有 All Rights Reserved.
Powered by
RedflagLinux!
技术支持:
中科红旗
|
京ICP备19024520号
快速回复
返回顶部
返回列表