linode_dynamic_dns 0.0.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/linode_dynamic_dns +19 -4
- data/lib/linode_dynamic_dns/config.rb +18 -8
- data/lib/linode_dynamic_dns/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9628e215941a08794f4ed38da514754673c23f44
|
4
|
+
data.tar.gz: 60d470e9bcd6f568b7be6b658a1a4cd8a08e3d2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 680737e96a84eabcc723bc6834f3af6065f0a4cd4028cd4187e7838d78fd2b38862b1dcca224dc7754d971ee0128924778cabf5989d5f3d2fdca7a129cd3c912
|
7
|
+
data.tar.gz: aeab5c165416815d0038c94e527d7e427a8be4daa1e64fa74e88e65c8752a218c019af5ef615a760eb8d08254330257cf36ef3819e9a91b670d63ef604b9ab78
|
data/bin/linode_dynamic_dns
CHANGED
@@ -2,15 +2,30 @@
|
|
2
2
|
#
|
3
3
|
require 'linode'
|
4
4
|
require 'linode_dynamic_dns'
|
5
|
+
require 'optparse'
|
6
|
+
|
7
|
+
@verbose = false
|
8
|
+
|
9
|
+
optparse = OptionParser.new do |opts|
|
10
|
+
opts.on('-v', '--verbose', "Print verbose output") do
|
11
|
+
@verbose = true
|
12
|
+
end
|
13
|
+
opts.on('-c', '--config CONFIG', "Specify a config file") do |arg|
|
14
|
+
@config = File.expand_path(arg)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
optparse.parse!
|
18
|
+
|
19
|
+
LinodeDynamicDns.set_config(@config) if @config
|
5
20
|
|
6
21
|
my_ip = LinodeDynamicDns.get_my_ip
|
7
|
-
puts "My IP is #{my_ip}"
|
22
|
+
puts "My IP is #{my_ip}" if @verbose
|
8
23
|
domain_id = LinodeDynamicDns.get_domain_id
|
9
|
-
puts "My Domain ID is #{domain_id}"
|
24
|
+
puts "My Domain ID is #{domain_id}" if @verbose
|
10
25
|
record_id = LinodeDynamicDns.get_record_id(domain_id)
|
11
|
-
puts "My Record ID is #{record_id}"
|
26
|
+
puts "My Record ID is #{record_id}" if @verbose
|
12
27
|
LinodeDynamicDns.update_record_ip(domain_id, record_id, my_ip)
|
13
|
-
puts "Updated #{LinodeDynamicDns.config.record}.#{LinodeDynamicDns.config.domain} to #{my_ip}"
|
28
|
+
puts "Updated #{LinodeDynamicDns.config.record}.#{LinodeDynamicDns.config.domain} to #{my_ip}" if @verbose
|
14
29
|
|
15
30
|
|
16
31
|
|
@@ -3,13 +3,23 @@ require 'yaml'
|
|
3
3
|
|
4
4
|
module LinodeDynamicDns
|
5
5
|
def self.config
|
6
|
-
@config ||=
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
@config ||= load_config_from(
|
7
|
+
File.join(
|
8
|
+
File.dirname(__FILE__), '../..', 'config',
|
9
|
+
'linode_dynamic_dns.yaml'
|
10
|
+
)
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.load_config_from(path)
|
15
|
+
OpenStruct.new(
|
16
|
+
YAML.load_file(
|
17
|
+
path
|
18
|
+
)
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.set_config(path)
|
23
|
+
@config = load_config_from(File.expand_path(path))
|
14
24
|
end
|
15
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linode_dynamic_dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grier Johnson
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.0.14
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: A small script for updating a linode dns record based on your current IP
|