動態 IP 架站 ddclient v3.6 安裝

FreeBSD安裝
tar xvzf ddclient-3.6.tar.gz

(1)
    #cd ddclient-3.5.3 
    #cp ddclient /usr/sbin/
    #ee /usr/sbin/ddclient
            找出get_ip段落...將(1457行)
            } elsif ($use eq 'if') {
                $skip  = opt('if-skip')  || '';
                $reply = `ifconfig $arg 2> /dev/null`;
                $reply = '' if $?;

            修改成
            } elsif ($use eq 'if') {
                $skip  = opt('if-skip')  || '';
                $reply = `/usr/sbin/showip.sh`;
                $reply = '' if $?;
            }

    # ee /usr/sbin/showip.sh
            #!/bin/csh
            echo `ifconfig tun0 | grep netmask | awk '{print $2}'` | awk '{n=0; do {n++} while ($n != ""); print$(n-1)}'
 
    #chmod 755 /usr/sbin/showip.sh
 
(2)
    #cp sample-etc_ddclient.conf /etc/ddclient.conf 
    #ee ddclient.conf
 
            use=if, if=tun0    # pppoe IP 位址的地方編號
            login=帳號 
            password=密碼 
            mx=帳號.homeip.net 帳號.homeip.net

            server=members.dyndns.org, 
            protocol=dyndns2 
            帳號.homeip.net
 
(3)
    #chmod 700 ddclient.conf
    #cp sample-etc_rc.d_init.d_ddclient /usr/local/etc/rc.d/ddclient.sh 
    #chmod 755 ddclient.sh 
    #./ddclient.sh start