aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>2016-08-10 15:28:46 +0000
committerpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>2016-08-10 15:28:46 +0000
commit30cfe4a53d809057390a79a7ed69cefb11ecfeeb (patch)
tree189fae0ff74b764bb229533d7db2167c1a389568
parentc71ea123369f8c6225957b14d2fb2291719beaab (diff)
downloadperlpsyc-30cfe4a53d809057390a79a7ed69cefb11ecfeeb.tar.gz
perlpsyc-30cfe4a53d809057390a79a7ed69cefb11ecfeeb.zip
remotor: don't fail creating the torlog socket
-rwxr-xr-xbin/psycamp4
-rwxr-xr-xbin/remotor14
2 files changed, 16 insertions, 2 deletions
diff --git a/bin/psycamp b/bin/psycamp
index a776cd0..88c546e 100755
--- a/bin/psycamp
+++ b/bin/psycamp
@@ -526,9 +526,9 @@ sub next {
526 my $f = $1 || $CurrentFile; 526 my $f = $1 || $CurrentFile;
527 $f =~ y/-/_/; 527 $f =~ y/-/_/;
528 &sys($has_espeak, '-v', 'en-german-5', '-p', 87, '-s', 101, $f); 528 &sys($has_espeak, '-v', 'en-german-5', '-p', 87, '-s', 101, $f);
529 &sys($has_espeak, '-v', 'en-romanian', '-p', 23, '-s', 87, '-k', 87,
530 rand(7) > 2 ? 'bullshit' : 'cool') if rand(9) > 7;
529 } 531 }
530 &sys($has_espeak, '-v', 'en-romanian', '-p', 23, '-s', 87, '-k', 87, rand(7) > 2 ? 'bullshit' : 'cool')
531 if $has_espeak and $opt_A;
532 &exit(0) if !$n or ($n eq '') or !$NS or $CS >= $NS; 532 &exit(0) if !$n or ($n eq '') or !$NS or $CS >= $NS;
533# return &next(0) if $opt_S and $n =~ /\b$KEEP\b/oi; 533# return &next(0) if $opt_S and $n =~ /\b$KEEP\b/oi;
534 &open( $n ); 534 &open( $n );
diff --git a/bin/remotor b/bin/remotor
index a038ecb..50a75f0 100755
--- a/bin/remotor
+++ b/bin/remotor
@@ -221,6 +221,18 @@ sub idlebilly {
221 print $torsock "GETINFO stream-status\n"; 221 print $torsock "GETINFO stream-status\n";
222} 222}
223 223
224sub mkdirhier {
225 my $d = shift;
226 if (-d $d) {
227# print STDERR BLUE, "(directory $d already exists)\n", RESET;
228 } else {
229 if (system('/bin/mkdir', '-p', $d)) {
230 undef $!;
231 die "Could not make directory hierarchy: $!"
232 if system('mkdirhier', $d);
233 }
234 }
235}
224 236
225## MAIN ### 237## MAIN ###
226 238
@@ -256,6 +268,8 @@ sub idlebilly {
256 $opt_m = $config{"$nick:monitor"} if !$opt_m and $config{"$nick:monitor"}; 268 $opt_m = $config{"$nick:monitor"} if !$opt_m and $config{"$nick:monitor"};
257 $torlog = $opt_m || "/var/run/tor/log.fifo"; 269 $torlog = $opt_m || "/var/run/tor/log.fifo";
258 if (($opt_m || $opt_f) and not -p $torlog) { 270 if (($opt_m || $opt_f) and not -p $torlog) {
271 $torlog =~ m#(.*)/[^/]+$#;
272 mkdirhier( $1 ) if $1;
259 undef $!; 273 undef $!;
260 die "Could not mkfifo $torlog: $!" unless mkfifo $torlog, 0600; 274 die "Could not mkfifo $torlog: $!" unless mkfifo $torlog, 0600;
261 system('chgrp', 'tor', $torlog); 275 system('chgrp', 'tor', $torlog);