summaryrefslogtreecommitdiff
path: root/SL2LS.pl
blob: b68a8e05f4f2a61324e5809d3e3c7dacefff9d22 (plain)
  1. #!/usr/bin/perl
  2. # Simple script. Right now, all that needs to be done is that the SL directory
  3. # needs to be deleted and the sql-ledger.conf needs to be renamed.
  4. $filedie = "To install manually:
  5. rename the sql-ledger.conf to ledger-smb.conf
  6. Delete the SL directory (optional but HIGHLY recommended)\n";
  7. open (SL, "< sql-ledger.conf") || die (
  8. "Could not open ledger-smb.conf: $! \n $filedie");
  9. open (LS, "> ledger-smb.conf") || die (
  10. "Could not open ledger-smb.conf: $! \n $filedie");
  11. while ($line = <SL>){
  12. print LS $line;
  13. }
  14. unlink "sql-ledger.conf";
  15. unlink "setup.pl";
  16. #TODO: Move/Delete the SL directory
  17. &recursive_unlink("SL");
  18. sub recursive_unlink {
  19. ($dir) = shift @_;
  20. print "Recursively deleting $dir\n";
  21. opendir (DIR, $dir);
  22. while ($file = readdir DIR){
  23. if ($file !~ /^\.+$/){
  24. $file = "$dir/$file";
  25. if (-f $file){
  26. unlink $file;
  27. } elsif (-d $file){
  28. &recursive_unlink("$file");
  29. }
  30. }
  31. }
  32. closedir(DIR);
  33. print "Removing $dir\n";
  34. rmdir $dir;
  35. }