Some services have underscores in their name
[aids.git] / lib / aids.rb
index 5893871dfe488b8acd4e42c56c72a8080786029b..ab3e4a50b2e59dbbb6df7a0e786c72a457924a7a 100644 (file)
@@ -1,3 +1,5 @@
+# Copyright (C) 2012  Steven McDonald <steven@steven-mcdonald.id.au>
+#
 # This program is free software. It comes without any warranty, to the
 # extent permitted by applicable law. You can redistribute it and/or
 # modify it under the terms of the Do What The Fuck You Want To Public
 # This program is free software. It comes without any warranty, to the
 # extent permitted by applicable law. You can redistribute it and/or
 # modify it under the terms of the Do What The Fuck You Want To Public
@@ -23,7 +25,7 @@ module AIDS
                                raise AIDS::Infection.new("Service name must be a non-empty string, got #{name.inspect}.")
                        end
                        name = $1 if name =~ %r{^/etc/init\.d/(.+)$}
                                raise AIDS::Infection.new("Service name must be a non-empty string, got #{name.inspect}.")
                        end
                        name = $1 if name =~ %r{^/etc/init\.d/(.+)$}
-                       if name =~ /[^[:alnum:]\-.]/
+                       if name =~ /[^[:alnum:]\-._]/
                                raise AIDS::Infection.new("Invalid init script name: #{name}.")
                        end
                        unless File.exist?("/etc/init.d/#{name}")
                                raise AIDS::Infection.new("Invalid init script name: #{name}.")
                        end
                        unless File.exist?("/etc/init.d/#{name}")