dunst 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +110 -0
  3. data/bin/dunst +6 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc2e13287babc40a024eae526f15e661b228f58c
4
- data.tar.gz: ed84292b1515e46c5ce373e6dae68cc1ddeec9ea
3
+ metadata.gz: 0605ff0137a017b0598809b50eed7c87bd4252f3
4
+ data.tar.gz: 1b3c19f76d20a856786b88f3c1f3e945d9ef5cf7
5
5
  SHA512:
6
- metadata.gz: 8cee46bbc75ba7a04a40d35ad56ae95ee16f93d20534a02b539d6f32db8f34525bc99bf9de39b3a09650af00f4a8249b16b0000f9e261675440eec5594c15795
7
- data.tar.gz: c3264ec8f843853394d0e0987a9a25f4ebeacc757ee3d1b902192d5e15a20e3567cc466d94b88f76d0421c8794514070db38625e7819778cc8afba066d6d37ca
6
+ metadata.gz: 5e37138c6170a389d90a2f2c1f5575c69a1f598006155e827a436a97c567765a46f3bf27faa742b7c2c6e40d83820dc6b330a5314a39ee2a5bc3f8eb7c952034
7
+ data.tar.gz: 0ac7e745a427600dbea4b5fb2a0183f75455db0e6fb1f7687388d1090763a8a604a01fcf0953d1fd6699b68211a0e29b0c5fbfe4bd2df8261a6bf1f659e641e0
data/README.md CHANGED
@@ -1,3 +1,113 @@
1
1
  # Dunst
2
2
 
3
3
  Simple cloud management tool using SSH and VMWare Workstation. Supporting clone, start and stop of VMs.
4
+
5
+ ## Usage
6
+
7
+ Call the ```dunst``` command for one server like this:
8
+
9
+ ```
10
+ dunst 192.168.0.1 user password cmd
11
+ ```
12
+
13
+ ### List available machines
14
+
15
+ To get a list of all available machines:
16
+
17
+ ```
18
+ dunst 192.168.0.1 user password list
19
+ ```
20
+
21
+ Returns:
22
+
23
+ ```
24
+ Count 3
25
+ ID VMX STATE MAC IP
26
+ 35986813758351367565 /home/dabo/vms/vmx/35986813758351367565/35986813758351367565.vmx halt 00:50:56:2e:c8:ad
27
+ 46478391399632621556 /home/dabo/vms/vmx/46478391399632621556/46478391399632621556.vmx run 00:50:50:2e:c8:ac 172.23.0.170
28
+ 94165679480162074298 /home/dabo/vms/vmx/94165679480162074298/94165679480162074298.vmx halt 00:50:51:2e:c8:ad
29
+ ```
30
+
31
+ ### Create new machine
32
+
33
+ To create a new machine:
34
+
35
+ ```
36
+ dunst 192.168.0.1 user password new
37
+ ```
38
+
39
+ Returns:
40
+
41
+ ```
42
+ OK 98680029932821660268
43
+ ```
44
+
45
+ ### Boot a machine
46
+
47
+ To start a machine:
48
+
49
+ ```
50
+ dunst 192.168.0.1 user password start 98680029932821660268
51
+ ```
52
+
53
+ Returns:
54
+
55
+ ```
56
+ OK 98680029932821660268
57
+ ```
58
+
59
+ ### Shutdown
60
+
61
+ To shutdown a machine (soft shutdown):
62
+
63
+ ```
64
+ dunst 192.168.0.1 user password halt 98680029932821660268
65
+ ```
66
+
67
+ Returns:
68
+
69
+ ```
70
+ OK 98680029932821660268
71
+ ```
72
+
73
+ ### Power Off
74
+
75
+ To power off a machine (hard shutdown):
76
+
77
+ ```
78
+ dunst 192.168.0.1 user password stop 98680029932821660268
79
+ ```
80
+
81
+ Returns:
82
+
83
+ ```
84
+ OK 98680029932821660268
85
+ ```
86
+
87
+ ### Reboot
88
+
89
+ To reboot a machine (soft reboot):
90
+
91
+ ```
92
+ dunst 192.168.0.1 user password reboot 98680029932821660268
93
+ ```
94
+
95
+ Returns:
96
+
97
+ ```
98
+ OK 98680029932821660268
99
+ ```
100
+
101
+ ### Reset
102
+
103
+ To reset a machine (hard reboot):
104
+
105
+ ```
106
+ dunst 192.168.0.1 user password reset 98680029932821660268
107
+ ```
108
+
109
+ Returns:
110
+
111
+ ```
112
+ OK 98680029932821660268
113
+ ```
data/bin/dunst CHANGED
@@ -28,7 +28,12 @@ end
28
28
 
29
29
  def get_ip(mac)
30
30
  Net::SSH.start(DHCP_HOST, USER, :password => KEY) do |ssh|
31
- exe(ssh, "cat /var/log/syslog | grep #{mac} | grep DHCPACK | tail -n1 | cut -d \" \" -f 8")
31
+ l = exe(ssh, "cat /var/log/syslog | grep #{mac} | grep DHCPACK | tail -n1")
32
+ if l.match(/on\s([0-9\.]*)\s/)
33
+ $1
34
+ else
35
+ ''
36
+ end
32
37
  end
33
38
  end
34
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dunst
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bovensiepen