2018-03-18 23:49:38 +01:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
# vim:sts=4:sw=4:tw=78
|
|
|
|
|
|
|
|
package esmith;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Errno;
|
|
|
|
use esmith::DB::db;
|
|
|
|
use IO::File;
|
|
|
|
use English;
|
|
|
|
|
|
|
|
# This script helps cleaning up only graphical settings for a user.
|
|
|
|
|
|
|
|
my $db_users = esmith::DB::db->open('accounts') || die("Cannot open e-smith db accounts: " . esmith::DB::db->error . "\n");
|
|
|
|
|
|
|
|
my $event = $ARGV[0];
|
|
|
|
|
|
|
|
defined $ARGV[1] || die("No user specified");
|
|
|
|
my $user = $ARGV[1];
|
|
|
|
|
|
|
|
profile_gui_clean($user);
|
|
|
|
|
|
|
|
sub profile_gui_clean {
|
|
|
|
my ($username) = @_;
|
|
|
|
my @u = $db_users->get($username) || die("No user record for '$username'.");
|
|
|
|
|
|
|
|
my @directories = (
|
|
|
|
".cache",
|
|
|
|
".config",
|
|
|
|
".gconf",
|
|
|
|
".kde",
|
|
|
|
".gnome2",
|
2018-03-19 23:31:23 +01:00
|
|
|
".gnome2_private",
|
|
|
|
".local"
|
2018-03-18 23:49:38 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
foreach (@directories) {
|
|
|
|
system("rm -rf /var/lib/nethserver/home/$username/$_") == 0 || die("Error cleaning up graphics settings for $username. Exiting.");
|
|
|
|
}
|
|
|
|
}
|