PERL   19

maintain emacswiki

Guest on 27th April 2022 05:31:35 PM

  1. #!/usr/bin/perl
  2. package OddMuse;
  3.  
  4. umask(066);
  5.  
  6. $AdminPass = '';
  7. do "/home/alex/password.pl";
  8. my $maint  = "/home/alex/emacswiki
  9.  
  10. /maintenance";
  11. my $text   = "$maint/curl.txt";
  12. my $html   = "$maint/last.html";
  13. my $params = "action=maintjob&pwd=$AdminPass";
  14. mkdir($maint) unless -d $maint;
  15. for my $f ($text, $html) {
  16.   unlink($f) or warn "Cannot delete $f: $!\n" if -f $f;
  17. }
  18. system("wget",
  19.        "-o", $text, # progress info
  20.        "-O", $html, # html output
  21.        "-U", "cron job", # user agent
  22.        "--post-data", $params,
  23.        "emacswiki/emacs");
  24. # make it readable
  25. my $mode = 0644;
  26. for my $f ($text, $html) {
  27.   chmod($mode, $f);
  28. }

Raw Paste


Login or Register to edit or fork this paste. It's free.