#!/usr/bin/perl -w # SqueezeCenter Copyright 2001-2007 Logitech. # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License, # version 2. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # require 5.008_001; use strict; use File::Path; use Getopt::Long; use constant SLIM_SERVICE => 0; use Slim::bootstrap; use Slim::Utils::OSDetect; sub main { Slim::Utils::OSDetect::init(); my $os = Slim::Utils::OSDetect->getOS(); my ($all, $cache, $prefs, $logs, $playlists); GetOptions( 'all' => \$all, 'cache' => \$cache, 'prefs' => \$prefs, 'logs' => \$logs ); my %folders; $folders{cache} = 'cache' if ($all || $cache); # $folders{playlists} = 'playlists' if ($all || $playlists); if ($all || $prefs) { $folders{prefs} = 'preferences'; $folders{oldprefs} = 'old preferences (SlimServer <= 6.5)'; } unless (scalar keys %folders) { usage(); exit; } for my $folder (keys %folders) { print "\nDeleting $folders{$folder} files and folders...\n"; foreach ($os->dirsFor($folder)) { print "-> $_\n"; # rmtree $_; } } print "\nDone. Please restart SqueezeCenter.\n\n"; } sub usage { print <