# dnspod-ip-update **Repository Path**: qiawei/dnspod-ip-update ## Basic Information - **Project Name**: dnspod-ip-update - **Description**: Linux下将本机IP更新至DNSPOD中 - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2016-02-28 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # dnspod-ip-update 本程序可以获取你的电脑的IP地址,并更新至DNSPOD中,主要用于在内网环境下需要连接主机,IP却经常在变的情况。 # 依赖 - PHP >= 5.4 - PHP CURL扩展 # 使用方法 ## 安装配置 1. 下载此代码,复制config.inc.sample.php至config.inc.php,填写空白内容。 2. 添加Crontab,设置每5分钟执行一次更新脚本。 ## 更新脚本 CentOS/Redhat系统,未禁用 shell_exec 函数 ``` php linux.php ``` 其它操作系统或禁用shell_exec函数 ``` 获取IP命令 | php load.php ``` 如Linux ``` /sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:" | php load.php ```