Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
#!/bin/sh -e | |
hostname=$1 | |
device=$2 | |
file=$HOME/.dynv6.addr6 | |
[ -e $file ] && old=`cat $file` | |
if [ -z "$hostname" -o -z "$token" ]; then | |
echo "Usage: token=<your-authentication-token> [netmask=64] $0 your-name.dynv6.net [device]" | |
exit 1 | |
fi |
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
# @author weishu @2015/12/7 | |
import subprocess | |
import os | |
import re | |
import json |
Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
/** | |
* 获取该条记录的自增ID | |
* 将自增转换为62进制,并拼接网址 如:http://qetee.com/w7e | |
* 用户访问到 http://qetee.com/w7e 时,提取短网址后缀 w7e | |
* 将短网址后缀转换为10进制,得到自增ID号 如:123456 | |
* 使用查询该记录,进行业务逻辑处理(比如跳转) | |
*/ | |
/** | |
* 十进制数转换成62进制 |