nfsadmin 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/nfsadmin +5 -0
- data/lib/nfsadmin/tasks.rb +17 -5
- data/lib/nfsadmin/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: b6c94061c5c00876cf185e93b32e40784c5775ad
|
4
|
+
data.tar.gz: 86b2988b4d4aa307c44b82482836a0645297b768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7431a7c5c7f7dc1ac7251a8bd2be89732a5701111edf85cbc72ac7469f6df2fa8a40665378ba3b84628a42b3c9c0566dabefa9bfd68e07a697ed50f5ae609e9
|
7
|
+
data.tar.gz: c77422dc03df9f6d13d0fc7e7b0421999b539ba1bb072387b5cc0621efac9ff97fd0d16188fd8040eb8c9761266a318609d98e0a4673229257e8bd766bc3f3e4
|
data/Gemfile.lock
CHANGED
data/bin/nfsadmin
CHANGED
@@ -4,10 +4,13 @@ require 'nfsadmin'
|
|
4
4
|
|
5
5
|
include GLI::App
|
6
6
|
|
7
|
+
subcommand_option_handling :normal
|
8
|
+
|
7
9
|
program_desc 'nfsadmin is a CLI to manage the NFS service and its exports'
|
8
10
|
|
9
11
|
version Nfsadmin::VERSION
|
10
12
|
|
13
|
+
|
11
14
|
flag [:c,:config], :default_value => '/etc/exports'
|
12
15
|
|
13
16
|
desc 'The export command manages exported NFS shares'
|
@@ -42,6 +45,8 @@ command :export do |c|
|
|
42
45
|
|
43
46
|
c.desc 'Delete an NFS export from this server'
|
44
47
|
c.command [:rm,:delete] do |delete|
|
48
|
+
delete.desc 'The location of the share to delete'
|
49
|
+
delete.flag [:l, :location]
|
45
50
|
delete.action do |global_options,options,args|
|
46
51
|
Nfsadmin::Tasks.delete_share(global_options[:c], options[:l])
|
47
52
|
end
|
data/lib/nfsadmin/tasks.rb
CHANGED
@@ -4,6 +4,18 @@ require 'fileutils'
|
|
4
4
|
module Nfsadmin
|
5
5
|
|
6
6
|
class Tasks
|
7
|
+
|
8
|
+
@service_cmd = ''
|
9
|
+
|
10
|
+
begin
|
11
|
+
file = File.new('/usr/sbin/service')
|
12
|
+
@service_cmd = '/usr/sbin/service'
|
13
|
+
rescue
|
14
|
+
file = File.new('/sbin/service')
|
15
|
+
@service_cmd = '/sbin/service'
|
16
|
+
end
|
17
|
+
|
18
|
+
|
7
19
|
def self.get_shares(exportsfile)
|
8
20
|
shares = []
|
9
21
|
location = ''
|
@@ -148,23 +160,23 @@ module Nfsadmin
|
|
148
160
|
end
|
149
161
|
|
150
162
|
def self.show_status
|
151
|
-
|
163
|
+
system "#{@service_cmd} nfs status"
|
152
164
|
end
|
153
165
|
|
154
166
|
def self.start_service
|
155
|
-
|
167
|
+
system "#{@service_cmd} nfs start"
|
156
168
|
end
|
157
169
|
|
158
170
|
def self.stop_service
|
159
|
-
|
171
|
+
system "#{@service_cmd} nfs stop"
|
160
172
|
end
|
161
173
|
|
162
174
|
def self.restart_service
|
163
|
-
|
175
|
+
system "#{@service_cmd} nfs restart"
|
164
176
|
end
|
165
177
|
|
166
178
|
def self.reload_config
|
167
|
-
|
179
|
+
system "#{@service_cmd} nfs reload"
|
168
180
|
end
|
169
181
|
end
|
170
182
|
|
data/lib/nfsadmin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nfsadmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bastiaan Schaap
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|