File: //scripts.20110531.215904.25158/quicksecure
#!/usr/bin/perl
# cpanel - quicksecure Copyright(c) 2010 cPanel, Inc.
# All rights Reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited
BEGIN { unshift @INC, '/usr/local/cpanel'; }
use Cpanel::SafeRun::Simple ();
open( STDERR, ">", "/dev/null" );
#----------------------------------------------------------------------
# List of processes that will be stopped/disable
my @serviceList1 = ( 'portmap', 'identd', 'lpd', 'apmd', 'atd', 'cups', 'innd', 'ypbind', 'nfslock', 'rpcidmapd' );
# List of processes that will not be stopped/disable
# when X-Window related applications are detected.
my @serviceList2 = ( 'gpm', 'pcmcia', 'smb', 'xfs' );
foreach my $serviceName (@serviceList1) {
Cpanel::SafeRun::Simple::saferun( '/scripts/cpservice', $serviceName, 'disable' );
Cpanel::SafeRun::Simple::saferun( '/scripts/cpservice', $serviceName, 'stop' );
}
foreach my $serviceName (@serviceList2) {
if ( -e "/usr/bin/netscape"
|| -e "/usr/bin/mozilla"
|| -e "/usr/X11R6/bin/xscreensaver"
|| -e "/usr/bin/gnome-sessions" ) {
print "X workstation, skipping " . $serviceName . " disable\n";
}
else {
Cpanel::SafeRun::Simple::saferun( '/scripts/cpservice', $serviceName, 'disable' );
Cpanel::SafeRun::Simple::saferun( '/scripts/cpservice', $serviceName, 'stop' );
}
}
#----------------------------------------------------------------------