替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。
获得 domain_id 可以用 curl
curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: supervisord | |
| # Required-Start: $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Example initscript | |
| # Description: This file should be used to construct scripts to be | |
| # placed in /etc/init.d. |
| import tornado.web | |
| class route(object): | |
| """ | |
| decorates RequestHandlers and builds up a list of routables handlers | |
| Tech Notes (or "What the *@# is really happening here?") | |
| -------------------------------------------------------- | |
| Everytime @route('...') is called, we instantiate a new route object which |
| #import <Foundation/Foundation.h> | |
| // convert a RFC3399 date (& time) into a NSDate object | |
| // NOTE: This function ignores fractions of a second in the RFC3339 | |
| // representation. | |
| NSDate *getDateObject(NSString *rfc3339) | |
| { | |
| // Date and Time representation in RFC3399: | |
| // Pattern #1: "YYYY-MM-DDTHH:MM:SSZ" | |
| // 1 |
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; path to your socket file | |
| [supervisord] | |
| logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
| logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
| logfile_backups=10 ; number of backed up logfiles | |
| loglevel=error ; info, debug, warn, trace | |
| pidfile=/var/run/supervisord.pid ; pidfile location | |
| nodaemon=false ; run supervisord as a daemon |
| worker_processes 2; | |
| error_log /var/log/nginx/error.log; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| use epoll; | |
| } |
替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。
获得 domain_id 可以用 curl
curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`| // | |
| // NSDate+RFC3339.h | |
| // | |
| // Created by Atsushi Nagase on 3/7/11. | |
| // Copyright 2011 LittleApps Inc. All rights reserved. | |
| // | |
| @interface NSDate (RFC3339) |
| import unittest, os, os.path, sys, urllib | |
| import tornado.database | |
| import tornado.options | |
| from tornado.options import options | |
| from tornado.testing import AsyncHTTPTestCase | |
| # add application root to sys.path | |
| APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
| sys.path.append(os.path.join(APP_ROOT, '..')) |
| import unittest, os, os.path, sys | |
| import tornado.database | |
| import tornado.options | |
| from tornado.options import options | |
| APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
| sys.path.append(os.path.join(APP_ROOT, '..')) | |
| # import your model module | |
| import your.model as model |