$ sudo ./phddns
Enter server address(press ENTER use phddns60.oray.net):
Enter your Oray account:username
Password:
Network interface(s):
[virbr0] = [IP:192.168.122.1]
[vmnet8] = [IP:192.168.64.1]
[vmnet1] = [IP:192.168.172.1]
[eth0] = [IP:192.168.199.146]
[lo] = [IP:127.0.0.1]
Choose one(default eth0):
Log to use(default /var/log/phddns.log):
/var/log/phddns.log
Save to configuration file (/etc/phlinux.conf)?(yes/no/other):
Save to configuration file (/etc/phlinux.conf)?(yes/no/other):yes
192.168.199.146
NIC bind success
defOnStatusChanged okConnecting
defOnStatusChanged errorConnectFailed
^Csignal = SIGINT
执行编译好的程序并配置(默认使用/etc/phlinux.conf,如果不存在这个文件则自动进入交互配置)
[root@localhost src]# ./phddns
输入服务器地址,如无特殊情况可使用默认值
Enter server address(press ENTER use phlinux3.oray.net):
输入您的Oray帐号名称
Enter your Oray account:
对应的Oray帐号密码
Password:
选择帮定的网卡,如无特殊,默认即可
Network interface(s):
eth0:192.168.141.18
lo:127.0.0.1
Choose one(default eth0):
选择日志保存到哪个文件
Log to use(default /var/log/phddns.log):
保存配置文件,选择yes则直接保存到/etc/phlinux.conf,输入other可以指定文件
Save to configuration file (/etc/phlinux.conf)?(yes/no/other):
接下来程序将已交互模式开始运行
192.168.141.18
NIC bind success
OnStatusChanged okConnecting
OnStatusChanged okDomainListed
OnDomainRegistered skyvense22.gicp.net
OnStatusChanged okDomainsRegistered
UserType: 0
看到上面这些就表示登录成功,这个时候可以按ctrl+c先退出程序
6、将phddns拷贝到你希望的位置
[root@localhost src]# cp phddns /usr/bin/
7、以后台模式启动花生壳(公网版)并检查运行情况
[root@localhost ~]# /usr/bin/phddns -c /etc/phlinux.conf -d
phlinux started as daemon!
[root@localhost ~]# tail /var/log/phddns.log
2011/08/02 11:28:58.256| ExecuteUpdate OK, BeginKeepAlive!
2011/08/02 11:29:59.354| SendKeepAlive() 8208
2011/08/02 11:30:00.355| RecvKeepaliveResponse() Data comes, OPCODE:8272
2011/08/02 11:30:00.356| Keepalive response received, client ip: 116.231.123.96
2011/08/02 11:31:00.447| SendKeepAlive() 8208
2011/08/02 11:31:01.450| RecvKeepaliveResponse() Data comes, OPCODE:8272
2011/08/02 11:31:01.450| Keepalive response received, client ip: 116.231.123.96
8、退出花生壳(公网版)
查看进程ID
[root@localhost ~]# ps -A | grep phddns
13731 ? 00:00:00 phlinux
让后台进程退出
[root@localhost ~]# kill -9 13731
9、将花生壳(公网版)加到系统启动时运行
[root@localhost ~]# vi /etc/rc.local
在文件的末尾加上一行:/usr/bin/phddns -c /etc/phlinux.conf -d
二、Linux花生壳(公网版)本命令行参数说明
[root@localhost ~]# /usr/bin/phlinux -h
Peanuthull Linux-core 2.0 by oray.com, copyright 2011
Peanuthull Linux-core Help
--first-run
-f, run for the first time
用于首次启动时配置参数
--interact
-i, run as interactive mode
program will request for necessary parameters.
this mode will automatically enabled at first running,
or your configuration file has been lost.
启动交互模式
--daemon
-d, run as a daemon
program will quit after put itself to background,
and continue running even you logout,
you can use kill -9 <PID> to terminate.
后台模式
--config
-c, run with configuration file
program will run with the file
指定使用哪一个配置文件
--user
-u, run as the user
program will run as the user
以指定用户启动后台进程
--help
-h, print this screen.
Please visit http://www.oray.com for detail.