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. 互联网点对点通讯(P2P)

    摘自: http://www.cnblogs.com/zhili/archive/2012/09/14/p2p_pnpr.html 很遗憾,目前看了下代码,我测试只是做到了本地p2p. [C# 网络编 ...

  2. 在SQL Server中对视图进行增删改

    原文:在SQL Server中对视图进行增删改 Lesktop开源IM发布以后,有一些网友问及如何在嵌入IM后与自己网站的用户系统整合(即如何让嵌入的IM直接使用网站原有的用户数据库,而不需要将已有的 ...

  3. POJ 1637 Sightseeing tour(最大流)

    POJ 1637 Sightseeing tour 题目链接 题意:给一些有向边一些无向边,问能否把无向边定向之后确定一个欧拉回路 思路:这题的模型很的巧妙,转一个http://blog.csdn.n ...

  4. 【转】怎么导出jar包

    如何导出jar包 右键工程->Export->Java->JAR file->Next-> Next 选中工程和工程中你要打包的内容,如果是Android的项目,需要把M ...

  5. 【转】Android Application 对象介绍

    What is Application Application和Activity,Service一样是android框架的一个系统组件,当android程序启动时系统会创建一个 application ...

  6. 【转载】深度解析Android中字体设置

    原文:http://mobile.51cto.com/android-265238.htm 1.在Android XML文件中设置字体 可以采用Android:typeface,例如android:t ...

  7. openGL剪裁区

    /** * 缓冲区工具类 */public class BufferUtil { /**  * 将浮点数组转换成字节缓冲区  */ public static ByteBuffer arr2ByteB ...

  8. Csharp Syntactic sugar

    C#语法糖(Csharp Syntactic sugar)大汇总 首先需要声明的是“语法糖”这个词绝非贬义词,它可以给我带来方便,是一种便捷的写法,编译器会帮我们做转换:而且可以提高开发编码的效率,在 ...

  9. DOM(一)

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  10. 实现 ready和bind事件

    Jquery揭秘系列:实现 ready和bind事件   讲这一节之前,先回顾之前的一篇<小谈Jquery>里面的代码: (function (win) { var _$ = functi ...