Skip to content

Commit

Permalink
Merge branch 'Void-0.3.6' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
szorfein committed Oct 26, 2023
2 parents 734ac1c + 4b1b4b5 commit c53de62
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize
end

def mkdir(path)
return unless File.exist?(path)
return if File.exist?(path)

x("mkdir -p #{path}")
end
Expand Down
4 changes: 3 additions & 1 deletion lib/spior/iptables/rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def insert_comment(spior_file, iptable_file)
end

def search_for_comment(filename)
return unless File.exist? filename

File.open(filename) do |f|
f.each do |line|
return true if line.match(/saved by Spior/)
Expand Down Expand Up @@ -88,7 +90,7 @@ def restoring_older_rules(filename)

def search_iptables_config
case Nomansland.distro?
when :archlinux || :void
when :archlinux && :void
'/etc/iptables/iptables.rules'
when :debian
'/etc/iptables.up.rules'
Expand Down
2 changes: 1 addition & 1 deletion lib/spior/tor/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def adding(content, option)
end

def digest_match?(src, dest)
return unless File.exist?(dest)
return unless File.exist?(dest) && File.readable?(dest)

md5_src = Digest::MD5.file src
md5_dest = Digest::MD5.file dest
Expand Down
3 changes: 2 additions & 1 deletion lib/spior/tor/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def initialize
def search(option_name)
File.open('/etc/tor/torrc') do |f|
f.each do |line|
return Regexp.last_match(1) if line.match(%r{#{option_name} ([a-z0-9./]*)}i)
line.match(%r{^#{option_name} ([a-z0-9./]*)}i) and
return Regexp.last_match(1)
end
end
false
Expand Down
7 changes: 0 additions & 7 deletions lib/spior/tor/stop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ module Tor
# It also kill previous instance run by Spior
class Stop
def initialize
old_pid = `pgrep -f "tor -f /tmp/torrc*"`.chomp

if old_pid != ''
Msg.p "Found old pid > #{old_pid}, killing it..."
Helpers::Exec.new('kill').run("-9 #{old_pid}")
end

nomansland
end

Expand Down

0 comments on commit c53de62

Please sign in to comment.