22:13 <@deBeuk> Dwarf: ripnews gaf een melding in mn logs met een verwijzing
naar http://procps.sf.net/faq.html 22:14 <@deBeuk> qua ps -aux zou depracated zijn en wat ander cruft
This commit is contained in:
parent
1ea456360c
commit
ca9fbd8029
1 changed files with 8 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/local/bin/ruby -w
|
||||
|
||||
# $Dwarf: ripnews.rb,v 1.77 2003/08/14 15:33:04 ward Exp $
|
||||
# $Dwarf: ripnews.rb,v 1.78 2003/09/23 14:43:26 ward Exp $
|
||||
# $Source$
|
||||
|
||||
#
|
||||
|
|
@ -134,6 +134,8 @@ def usage
|
|||
end
|
||||
|
||||
def parse_config(default = {})
|
||||
print "Parsing config\n"
|
||||
print "#{default[\"-c\"]}\n"
|
||||
if FileTest.readable?("#{default[\"-c\"]}")
|
||||
file = File.new("#{default[\"-c\"]}")
|
||||
lines = file.readlines
|
||||
|
|
@ -262,7 +264,7 @@ def lock
|
|||
lock.close
|
||||
if line
|
||||
line.chomp!
|
||||
psauxw = `ps -auxw`
|
||||
psauxw = `ps auxw`
|
||||
if /^\S+\s+#{line}\s+/.match(psauxw)
|
||||
print "Already running, exiting...\n"
|
||||
exit
|
||||
|
|
@ -492,7 +494,7 @@ end
|
|||
|
||||
#############################################################################################
|
||||
|
||||
$stdout.sync=true # line buffered output
|
||||
$stdout.sync=true # line buffered output
|
||||
@defaults = {'-c' => "#{ENV['HOME']}/.ripnewsrc"}
|
||||
@defaults = parse_options(@defaults)
|
||||
@config = parse_config(@defaults)
|
||||
|
|
@ -502,14 +504,14 @@ lock
|
|||
renice
|
||||
|
||||
trap("HUP") {
|
||||
puts "Rereading config...\n"
|
||||
print "Rereading config...\n"
|
||||
config = parse_config(@defaults)
|
||||
if config != false
|
||||
@config = config
|
||||
check_config
|
||||
puts "Done reading config\n"
|
||||
print "Done reading config\n"
|
||||
else
|
||||
puts "Keeping old config due to errors\n"
|
||||
print "Keeping old config due to errors\n"
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue