summaryrefslogtreecommitdiff
path: root/SL2LS.pl
blob: 50b1e098d389fb4624fd77536c05b7892169e6d5 (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. open (SL, "< sql-ledger.conf");
  5. open (LS, "> ledger-smb.conf");
  6. while ($line = <SL>){
  7. print LS $line;
  8. }
  9. unlink "sql-ledger.conf";
  10. unlink "setup.pl";
  11. #TODO: Move/Delete the SL directory
  12. &recursive_unlink("SL");
  13. sub recursive_unlink {
  14. ($dir) = shift @_;
  15. print "Recursively deleting $dir\n";
  16. opendir (DIR, $dir);
  17. while ($file = readdir DIR){
  18. if ($file !~ /^\.+$/){
  19. $file = "$dir/$file";
  20. if (-f $file){
  21. unlink $file;
  22. } elsif (-d $file){
  23. &recursive_unlink("$file");
  24. }
  25. }
  26. }
  27. closedir(DIR);
  28. print "Removing $dir\n";
  29. rmdir $dir;
  30. }