Using this tool -> inadyn

apt-get install inadyn -y

Usage:

https://github.com/troglobit/inadyn#example-configuration

Suggested free DDNS providers: freedns.afraid.org, noip.com and etc..

auto-startup script as a service

knowledge from: http://www.linuxquestions.org/questions/linux-software-2/how-do-i-execute-inadyn-automatically-during-boot-541367/

And

Init script for Inadyn

First of all you have to create (or edit) inadyn configuration file:

$~ mkdir /var/cache/inadyn

Edit this file:

/etc/inadyn.conf

this way

Code:
# Basic configuration file for inadyn
#
# /etc/inadyn.conf
#update_period_sec # Check for a new IP every seconds
background
verbose
period
cache-dir /var/cache/inadyn
startup-delay
logfile /var/log/ddns.log
pidfile /var/run/ddns.pid    system default@freedns.afraid.org
ssl
username abcdefsafdsa
password fdadfferfsadf
alias oneofyour.donated.com
alias another.tooms.to
 

Now put this code in /etc/init.d/inadyn

Code:
#!/bin/bash
case "$1" in
start)
if [ -f /tmp/inadyn.pid ]; then
PID=$(cat /tmp/inadyn.pid)
kill - ${PID} &>/dev/null
if [ $? = ]; then
echo "Inadyn is already running."
else
/usr/sbin/inadyn
pidof inadyn > /tmp/inadyn.pid
PID=$(cat /tmp/inadyn.pid)
kill - ${PID} &>/dev/null
if [ $? = ]; then
echo "Inadyn started succesfully."
else
echo "Error starting Inadyn"
fi
fi
else
/usr/sbin/inadyn
pidof inadyn > /tmp/inadyn.pid
PID=$(cat /tmp/inadyn.pid)
kill - ${PID} &>/dev/null
if [ $? = ]; then
echo "Inadyn started succesfully."
else
echo "Error starting Inadyn"
fi
fi
;;
stop)
if [ -f /tmp/inadyn.pid ];then
PID=$(cat /tmp/inadyn.pid)
kill - ${PID} &>/dev/null
if [ $? = ]; then
/bin/kill ${PID}
kill - ${PID} &>/dev/null
if [ $? = ]; then
echo "Inadyn stopped succesfully."
else
echo "Error stopping Inadyn"
fi
else
echo "Inadyn is already stopped."
fi
else
echo "Inadyn is already stopped."
fi
;;
reload|restart)
$ stop
$ start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit
esac
exit

Then create these two links to start and stop service at system boot and shutdown:

ln -s /etc/init.d/inadyn /etc/rc2.d/S03inadyn
ln -s /etc/init.d/inadyn /etc/rc0.d/K03inadyn
 

Then you can use:

service inadyn start

DDNS client on a Linux machine的更多相关文章

  1. Deploying OpenFire for IM (instant message) service (TCP/IP service) with database MySQL , client Spark on linux部署OpenFire IM 消息中间件服务

    Are you a hacker? How to build another QQ/Wechat/whatsapp/skype/imessage? Let's go through this!!!! ...

  2. VNCServer,SSH Secure Shell Client,window远程控制linux

    1.VNC远程连接linux图形化桌面 2.SSH Secure Shell Client连接linux终端 3.设置FTP与linux传输文件 1.VNC远程连接linux图形化桌面 在centos ...

  3. windows下使用 Secure Shell Client工具操作linux常用命令

    如果项目部署在linux系统上,而我们使用的是windows系统,那我们可以使用Secure Shell软件进行操作,那怎么使用它来操作tomcat呢? 1.  cd /usr/share/apach ...

  4. Xmpp integration with Asterisk

    http://gnu-linux.org/xmpp-integration-with-asterisk.html Xmpp stands for eXtensible Messaging and Pr ...

  5. Wmic-linux

    Description Windows Management Instrumentation Command-line (WMIC) uses Windows Management Instrumen ...

  6. (OK) Linux epoll模型—socket epoll server client chat

    http://www.cnblogs.com/venow/archive/2012/11/30/2790031.html http://blog.csdn.net/denkensk/article/d ...

  7. delphi 开发者 linux 实务(转)

    Linux Essentials for Delphi Developers   There is currently no way using Delphi to target Linux. Lon ...

  8. LoadRunner监控Linux

    rstat协议允许网络上的用户获得同一网络上各机器的性能参数. 需要下载3个包:    (1)rsh-0.17-14.i386.rpm     (2)rsh-server-0.17-14.i386.r ...

  9. Linux下安装使用NMON监控、分析系统性能

    背景:今天在LoadRunner11.0中使用rstat监控linux过程中,始终提示如下错: Monitor name :UNIX Resources. Cannot initialize the ...

随机推荐

  1. 健身小管家--android app源码

    把做了近一个月的android程序源码放出来,里面包括但不限于如下内容: 1. 简单的android项目结构 2. 通用的adapter,不再为每一个ListView都写一个adapter,只要用此一 ...

  2. UITableView刷新局部

    //局部section刷新 NSIndexSet *nd = [[NSIndexSet alloc] initWithIndex:1]; //刷新第二个section [self.tableView ...

  3. NET 2015

    .NET 2015 英文原文:Understanding .NET 2015 Understanding 翻译为了解或理解,对于 .NET 来说,2015 年注定会更加精彩,所以标题就用了“精彩”这个 ...

  4. 高速掌握sinox2014激动人心的ZFS和RAID技术

    Sinox2014引入激动人心的zfs系统以及其支持的RAID,让用户高速打造便宜的高可靠性文件server. ZFS文件系统的英文名称为Zettabyte File System,也叫动态文件系统( ...

  5. 事半功倍之StyleCop(一)

    事半功倍之StyleCop(一) 前言 曾几何时,你是否在看别人代码的时候总是在抱怨代码没有注释,命名不规范,代码风格不统一,代码可读性差?是否有一个适合团队开发规范的检查工具? 答案就是大名鼎鼎的S ...

  6. mongodb操作之使用javaScript实现多表关联查询

    一.数据控制 mongodb操作数据量控制,千万控制好,不要因为操作的数据量过多而导致失败. 演示一下发生此类错误的错误提示:

  7. ssis的script task作业失败(调用外部dll)

    原文 ssis的script task作业失败 我的ssis作业包里用了一个script task,会查询一个http的页面接口,获取json数据后解析然后做后续处理,其中解析json引用了本地目录下 ...

  8. IQueryable与IQEnumberable的区别

    IEnumberable接口: 公开枚举器,该枚举器支持在指定类型的集合上进行简单迭代.也就是说:实现了此接口的object,就可以直接使用froeach遍历此object; IQueryable接口 ...

  9. 代码审查 (Google牛人谈Code Review)

    代码审查 (Google牛人谈Code Review) 在上一篇博客里我暗示自己将不在为Google工作. 我还没有决定好去哪儿-有几个非常不错的工作机会让我选择.鉴于这段时间内我不受雇于任何公司,我 ...

  10. 个推 Spark实践教你绕过开发那些“坑”

    Spark作为一个开源数据处理框架,它在数据计算过程中把中间数据直接缓存到内存里,能大大提高处理速度,特别是复杂的迭代计算.Spark主要包括SparkSQL,SparkStreaming,Spark ...