summaryrefslogtreecommitdiff
path: root/SL2LS.pl
blob: 0425df4019db602d0bb3b721cad222917215e680 (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. #TODO: Move/Delete the SL directory
  16. &recursive_unlink("SL");
  17. sub recursive_unlink {
  18. ($dir) = shift @_;
  19. print "Recursively deleting $dir\n";
  20. opendir (DIR, $dir);
  21. while ($file = readdir DIR){
  22. if ($file !~ /^\.+$/){
  23. $file = "$dir/$file";
  24. if (-f $file){
  25. unlink $file;
  26. } elsif (-d $file){
  27. &recursive_unlink("$file");
  28. }
  29. }
  30. }
  31. closedir(DIR);
  32. print "Removing $dir\n";
  33. rmdir $dir;
  34. }