|
我在Win下已解决,但Linux刚用,还不熟,不会写sh,就求教各位了。
附Win下.cmd代码,作系统服务运行的。
- @echo off
- :run
- for /F "tokens=2 delims=:" %%i in ('ipconfig ^|find "IP Address" ^|find " 218."') do set _IP=%%i
- REM 因为开了IPv6,要排除那个IPv6的IP Address。
- for /F "tokens=1" %%i in ('echo %_IP%') do set _IP=%%i
- set _domainID=1
- set _user=******
- set _passwd=******
- wget --http-user=%_user% --http-passwd=%_passwd% "http://www.3322.org/dyndns/update?system=dyndns&hostname=***%_domainID%.3322.org&myip=%_IP%&wildcard=ON" -O log.txt
- set _user=
- set _passwd=
- type log.txt
- ping -w 900000 -n 1 1.1.1.1 2>nul >nul
- REM 延时
- goto:run
复制代码
再问,感觉直接塞到用户home下的那个隐藏的启动文件夹(KDE)没技术含量。我目前用OpenSUSE(就10.2那个),在启动中网卡初始后运行要如何调?
不过目前只要能让它后台运行就够了。 |
|