Module: Spior::Service
- Defined in:
- lib/spior/service.rb,
lib/spior/service/stop.rb,
lib/spior/service/start.rb,
lib/spior/service/enable.rb,
lib/spior/service/restart.rb
Overview
Interact with Spior::Tor and Spior::Iptables
Defined Under Namespace
Classes: Enable
Class Method Summary collapse
- .restart ⇒ Object
-
.start ⇒ Object
Service.start should start Tor if not alrealy running And start to redirect the local traffic with Iptables.
- .stop(clean: true) ⇒ Object
Class Method Details
.restart ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/spior/service/restart.rb', line 10 def restart case Nomansland.init? when :systemd Helpers.cmd('systemctl restart tor') when :openrc Helpers.cmd('/etc/init.d/tor restart') when :runit Helpers.cmd('sv restart tor') else puts 'No init found (systemd, openrc, runit)...' end Msg.p 'Tor restarting, ip changed.' end |