summaryrefslogtreecommitdiff
path: root/SL2LS.pl
diff options
context:
space:
mode:
Diffstat (limited to 'SL2LS.pl')
-rwxr-xr-xSL2LS.pl24
1 files changed, 23 insertions, 1 deletions
diff --git a/SL2LS.pl b/SL2LS.pl
index 4824d2c6..50b1e098 100755
--- a/SL2LS.pl
+++ b/SL2LS.pl
@@ -10,6 +10,28 @@ while ($line = <SL>){
print LS $line;
}
-unlink sql-ledger.conf;
+unlink "sql-ledger.conf";
+unlink "setup.pl";
#TODO: Move/Delete the SL directory
+
+&recursive_unlink("SL");
+
+sub recursive_unlink {
+ ($dir) = shift @_;
+ print "Recursively deleting $dir\n";
+ opendir (DIR, $dir);
+ while ($file = readdir DIR){
+ if ($file !~ /^\.+$/){
+ $file = "$dir/$file";
+ if (-f $file){
+ unlink $file;
+ } elsif (-d $file){
+ &recursive_unlink("$file");
+ }
+ }
+ }
+ closedir(DIR);
+ print "Removing $dir\n";
+ rmdir $dir;
+}