项目作者: Manu-sh

项目描述 :
daemon to notify on your gmail account when public ip address change
高级语言: Ruby
项目地址: git://github.com/Manu-sh/ipnotify.git
创建时间: 2018-02-02T23:01:33Z
项目社区:https://github.com/Manu-sh/ipnotify

开源协议:GNU General Public License v3.0

下载


ipnotify

notify to your gmail account when public ip address change

Installation

You can also install ipnotify as normal user (and maybe is a better choice)
but isn’t covered by this readme.

  1. git clone https://github.com/Manu-sh/ipnotify
  2. sudo gem install gmail
  3. cd ipnotify
  4. # ensure that all files have correct permissions
  5. chmod 0744 .
  6. chmod 0600 ipnotify.*
  7. chmod 0644 *.rb
  8. chmod 0755 ipnotify.rb
  9. # now as root
  10. cp -r ../ipnotify /opt
  11. # install the configuration file
  12. mv -v /opt/ipnotify/ipnotify.cfg /etc
  13. # create the relative service
  14. cat > /etc/systemd/system/ipnotify.service << EOF
  15. [Unit]
  16. Description=notify to your gmail account when your public ip address change
  17. After=network.target
  18. [Service]
  19. User=root
  20. PIDFile=/var/run/ipnotify.pid
  21. Type=forking
  22. ExecStart=/opt/ipnotify/ipnotify.rb -d
  23. ProtectKernelTunables=yes
  24. ProtectKernelModules=yes
  25. [Install]
  26. WantedBy=multi-user.target
  27. EOF

Configuration

Edit ipnotify.cfg and setting your mail address and password,
some command line options like --hostname can be specificated also
throught the configuration file, to get more details on these common options
type:

/opt/ipnotify/ipnotify.rb -h

now you should be able enable & start the service

  1. sudo systemctl enable ipnotify.service
  2. sudo systemctl start ipnotify.service