Sindbad~EG File Manager

Current Path : /opt/ISLOnline/ISLAlwaysOn/
Upload File :
Current File : //opt/ISLOnline/ISLAlwaysOn/uninstall.pl

#!/usr/bin/perl
use strict;
use POSIX;
if (POSIX::geteuid != 0) {
	system('/usr/bin/pkexec', '/opt/ISLOnline/ISLAlwaysOn/uninstall.pl') && die;
	exit 1;
}

if (-e '/opt/ISLOnline/ISLAlwaysOn/ISLAlwaysOn') {
	system('/opt/ISLOnline/ISLAlwaysOn/ISLAlwaysOn', 'uninstall') and die;
}

sub chkRun($) {
    my ($name) = @_;
    open my $fh, '-|', 'ps', '-C', $name, '-o', 'args=' or return 0;
    my $v = do { local $/; <$fh> };
    close $fh;
    return index($v, '/opt/ISLOnline/ISLAlwaysOn/' . $name) != -1;
}

sub rmf($) {
	my ($file) = @_;
	if (-e '/opt/ISLOnline/ISLAlwaysOn/' . $file) {
		system('rm', '-f', '/opt/ISLOnline/ISLAlwaysOn/' . $file) and die;
	}
}

system("rm -f '/etc/islonline/islalwayson\%3a\%3aDir'");

if (chkRun('ISLAlwaysOn')) {
	system('killall', 'ISLAlwaysOn');
}

if (1) {
	my $xdg_desktop_menu_path=`which xdg-desktop-menu 2>/dev/null`;
	if ($? == 0) {
		foreach my $file ('islonline-item.desktop', 'islonline-item_uninstall.desktop') {
			if (-e '/opt/ISLOnline/ISLAlwaysOn/' . $file) {
				system('xdg-desktop-menu uninstall', '/opt/ISLOnline/ISLAlwaysOn/' . $file);
			}
		}
	}else {
		print "xdg-desktop-menu command is not valid. try installing xdg-utils and then run following command: xdg-desktop-menu uninstall '" . '/opt/ISLOnline/ISLAlwaysOn/islonline' . "-item_uninstall.desktop'
";
	}
}

foreach my $file ("checkstart_proto", "checkstart_run", 'islonline-item.desktop', 'islonline-item_uninstall.desktop') {
	rmf($file);
}

if (chkRun('issc_daemon') || chkRun('ISLLightFast')) {
	print "issc_daemon or ISLLightFast is still running - you will have to remove the files manually
";
	exit 0;
}

foreach my $file ('ISLAlwaysOn', "ISLLightFast", "libplugin_desktop.so", "libdatachannel.so", "pack_core.sh", "issc_stream", "issc_daemon", "issc_lock_desktop", "store_product_flags", "issc_daemon.json") {
	rmf($file);
}

foreach my $file ("DefaultConfiguration.ini", "StaticConfiguration.ini", "Custom.ini", "branch.txt", "customization.txt", "desktop.png", "custom_icon.png") {
	rmf($file);
}

foreach my $folder ("translations") {
	if (-e '/opt/ISLOnline/ISLAlwaysOn' . "/$folder") {
		system('rm', '-rf', '/opt/ISLOnline/ISLAlwaysOn/' . $folder) and die;
	}
}

if (1) {
	system('rm', '-f', '/opt/ISLOnline/ISLAlwaysOn/uninstall.pl');
}

system('rm', '-f', '/opt/ISLOnline/ISLAlwaysOn/uninstall.pl') and die;

exit 0;

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists