Git Product home page Git Product logo

sasan's People

Watchers

James Cloos avatar

sasan's Issues

Vpn

#!/bin/sh -e # based on https://gist.github.com/corny/7a07f5ac901844bd20c9 # modify by ifeng; May 13, 2021 #hostname=$1 #device=$2 # Enter the relevant parameters in line 10-12. “device” enter the interface name, such as pppoe0, switch0, it is recommended to enter pppoe0. token=your token hostname=example.dynv6.net device=pppoe0 file=$HOME/.dynv6.addr6 [ -e $file ] && old=cat $file if [ -z "$hostname" -o -z "$token" ]; then echo "Usage: token= [netmask=64] $0 your-name.dynv6.net [device]" exit 1 fi if [ -z "$netmask" ]; then netmask=128 fi if [ -n "$device" ]; then device="dev $device" fi #address=$(ip -6 addr list scope global $device | grep -v " fd" | sed -n 's/.inet6 ([0-9a-f:]+)./\1/p' | head -n 1) if [ -e /usr/bin/curl ]; then bin="curl -fsS" elif [ -e /usr/bin/wget ]; then bin="wget -O-" else echo "neither curl nor wget found" exit 1 fi #if [ -z "$address" ]; then # echo "no IPv6 address found" # exit 1 #fi # When the address is empty, wait for 1 minute and then assign the value again. The loop ends after 30 times. i=1 while [ $i -lt 30 ] do address=$(ip -6 addr list scope global $device | grep -v " fd" | sed -n 's/.inet6 ([0-9a-f:]+)./\1/p' | head -n 1) if [ -z "$address" ]; then sleep 1m ((i++)) else break fi done # address with netmask current=$address/$netmask if [ "$old" = "$current" ]; then echo "IPv6 address unchanged" exit fi # send addresses to dynv6 $bin "http://dynv6.com/api/update?hostname=$hostname&ipv6=$current&token=$token" $bin "http://ipv4.dynv6.com/api/update?hostname=$hostname&ipv4=auto&token=$token" # save current address echo $current > $file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.