BusyBox v1.22.1 (2014-09-20 22:31:09 CEST) built-in shell (ash) Enter 'help'for a list of built-in commands.
_______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- BARRIER BREAKER (14.07, r42625) ----------------------------------------------------- * 1/2 oz Galliano Pour all ingredients into * 4 oz cold Coffee an irish coffee mug filled * 1 1/2 oz Dark Rum with crushed ice. Stir. * 2 tsp. Creme de Cacao ----------------------------------------------------- # opkg update Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/packages/base/Packages.gz. Updated list of available packages in /var/opkg-lists/barrier_breaker_base. Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/packages/luci/Packages.gz. Updated list of available packages in /var/opkg-lists/barrier_breaker_luci. Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/packages/packages/Packages.gz. Updated list of available packages in /var/opkg-lists/barrier_breaker_packages. Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/packages/routing/Packages.gz. Updated list of available packages in /var/opkg-lists/barrier_breaker_routing. Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/packages/telephony/Packages.gz. Updated list of available packages in /var/opkg-lists/barrier_breaker_telephony. Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/packages/management/Packages.gz. Updated list of available packages in /var/opkg-lists/barrier_breaker_management. Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/packages/oldpackages/Packages.gz. Updated list of available packages in /var/opkg-lists/barrier_breaker_oldpackages. Downloading http://openwrt-dist.sourceforge.net/releases/ar71xx/packages/Packages.gz. Updated list of available packages in /var/opkg-lists/openwrt_dist. Downloading http://openwrt-dist.sourceforge.net/releases/luci/packages/Packages.gz. Updated list of available packages in /var/opkg-lists/openwrt_dist_luci. # opkg install wget Installing wget (1.16-1) to root... Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/packages/packages/wget_1.16-1_ar71xx.ipk. Configuring wget.
######################################## # # Tommy DnsPod DDNS Client v0.1.0 # # Author: Tommy Lau <[email protected]> # # Created: 2015-02-23 08:52:00 UTC # Updated: 2015-02-23 12:15:46 UTC # ########################################
# Use 'json', other option is 'xml' format='json'
# Use English for default, 'cn' for Chinese language='en'
# API URL api_url='https://dnsapi.cn/'
# Get current IP get_ip() { local inter="http://members.3322.org/dyndns/getip" wget --quiet --no-check-certificate --output-document=- $inter #curl --silent $inter }
# Send the API request to DnsPod API # @param1: The command to execute, for example, Info.Version and etc. # @param2: The parameters to send to the API, for example, domain='domain.tld' api_post() { # Client agent local agent="Tommy DnsPod Client/0.1.0 ([email protected])"
# Stop if no API command is given local inter="$api_url${1:?'Info.Version'}"
# Default post content for every request local param="login_email=$email&login_password=$password&format=$format&lang=$language&${2}"
# Lookup current ip # @param1: The domain to nslookup dns_lookup() { local server="114.114.114.114" nslookup ${1}$server | tr -d '\n[:blank:]' | sed 's/.\+1 \([0-9\.]\+\).*/\1/' }
# Update the DNS record # @param1: The domain name to update, for example, 'domain.tld' # @param2: The subdomain, for example, 'www' dns_update() { local current_ip=$(get_ip) local dns_ip=$(dns_lookup "${2}.${1}")
echo"${current_ip} : ${dns_ip}"
if [ "$current_ip" == "$dns_ip" ]; then echo"No need to update DDNS." return 0 fi
# Get domain id local domain_id=$(api_post "Domain.Info""domain=${1}") domain_id=$(echo$domain_id | sed 's/.\+{"id":"\([0-9]\+\)".\+/\1/')
# Get record id of the subdomain local record_id=$(api_post "Record.List""domain_id=${domain_id}&sub_domain=${2}") record_id=$(echo$record_id | sed 's/.\+\[{"id":"\([0-9]\+\)".\+/\1/')
# Update the record local result=$(api_post "Record.Ddns""domain_id=${domain_id}&record_id=${record_id}&record_line=默认&sub_domain=${2}") result_code=$(echo$result | sed 's/.\+{"code":"\([0-9]\+\)".\+/\1/') result_message=$(echo$result | sed 's/.\+,"message":"\([^"]\+\)".\+/\1/')