<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>InstaCarma Blog &#187; script</title>
	<atom:link href="http://instacarma.com/blog/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://instacarma.com/blog</link>
	<description>Information Resource for Web Hosting Technical Support and Server Management</description>
	<lastBuildDate>Sat, 04 Sep 2010 16:06:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Script for restoring multiple accounts from backup</title>
		<link>http://instacarma.com/blog/technical/script-for-restoring-multiple-accounts-from-backup/</link>
		<comments>http://instacarma.com/blog/technical/script-for-restoring-multiple-accounts-from-backup/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 20:24:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=1002</guid>
		<description><![CDATA[The following script can be used to restore multiple accounts from the backups. It is assumed that all the backup files are already present in the /home directory in the tar.gz format. #!/bin/bash ####################### for i in `ls &#124; grep tar.gz &#124; cut -d- -f2 &#124; cut -d. -f1` do echo &#8220;Restoring $i&#8230;.&#8221; /scripts/restorepkg $i [...]]]></description>
			<content:encoded><![CDATA[<p>The following script can be used to restore multiple accounts from the backups.</p>
<p>It is assumed that all the backup files are already present in the <em>/home</em> directory in the tar.gz format.</p>
<blockquote><p>#!/bin/bash</p>
<p>#######################<br />
for i in `ls | grep tar.gz | cut -d- -f2 | cut -d. -f1`<br />
do<br />
echo &#8220;Restoring $i&#8230;.&#8221;<br />
/scripts/restorepkg $i<br />
echo &#8220;$i restored&#8221;<br />
echo &#8220;====================&#8221;<br />
done<br />
echo &#8220;Restoration completed&#8221;<br />
#######################</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://instacarma.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://instacarma.com/blog/technical/script-for-restoring-multiple-accounts-from-backup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shell script for packaging all accounts</title>
		<link>http://instacarma.com/blog/technical/shell-script-for-packaging-all-accounts/</link>
		<comments>http://instacarma.com/blog/technical/shell-script-for-packaging-all-accounts/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 20:20:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=913</guid>
		<description><![CDATA[Issue : How can I run a &#8216;pkgacct&#8217; for all the accounts on the server in one go? Solution: Here&#8217;s a simple script to package all the accounts on your server : #!/bin/bash IFS=&#8221;$&#8221; /bin/ls &#8212; /var/cpanel/users &#124; /bin/grep -v &#8220;\.\&#124;root\&#124;mysql\&#124;nobody\&#124;cpanel&#8221; &#124; while read CPUSER; do /scripts/pkgacct &#8220;${CPUSER}&#8221; done]]></description>
			<content:encoded><![CDATA[<p><strong>Issue : </strong></p>
<p>How can I run a &#8216;pkgacct&#8217; for all the accounts on the server in one go?</p>
<p><strong>Solution:</strong></p>
<p>Here&#8217;s a simple script to package all the accounts on your server : </p>
<blockquote><p>
#!/bin/bash<br />
IFS=&#8221;$&#8221;</p>
<p>/bin/ls &#8212; /var/cpanel/users | /bin/grep -v &#8220;\.\|root\|mysql\|nobody\|cpanel&#8221; | while read CPUSER; do<br />
   /scripts/pkgacct &#8220;${CPUSER}&#8221;<br />
done</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://instacarma.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://instacarma.com/blog/technical/shell-script-for-packaging-all-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful cPanel scripts and their functions</title>
		<link>http://instacarma.com/blog/technical/useful-cpanel-scripts-and-their-functions/</link>
		<comments>http://instacarma.com/blog/technical/useful-cpanel-scripts-and-their-functions/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 19:09:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Articles and tutorials]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=637</guid>
		<description><![CDATA[Following are the cPanel scripts and their functions. adddns &#8211; Adds a DNS zone. addfpmail &#8211; Add frontpage mail extensions to all domains without them. addfpmail2 -Add frontpage mail extensions to all domains without them. addnetmaskips &#8211; Add the netmask 255.255.255.0 to all IPs that have no netmask. addnobodygrp &#8211; Adds the group nobody and [...]]]></description>
			<content:encoded><![CDATA[<p>Following are the cPanel scripts and their functions.</p>
<p>adddns &#8211; Adds a DNS zone.<br />
addfpmail &#8211; Add frontpage mail extensions to all domains without them.<br />
addfpmail2 -Add frontpage mail extensions to all domains without them.<br />
addnetmaskips &#8211; Add the netmask 255.255.255.0 to all IPs that have no netmask.<br />
addnobodygrp &#8211; Adds the group nobody and activates security.<br />
addpop &#8211; Add a Pop Account.adddns &#8211; Adds a DNS zone.<br />
addfpmail &#8211; Add frontpage mail extensions to all domains without them.<br />
addfpmail2 -Add frontpage mail extensions to all domains without them.<br />
addnetmaskips &#8211; Add the netmask 255.255.255.0 to all IPs that have no netmask.<br />
addnobodygrp &#8211; Adds the group nobody and activates security.<br />
addpop &#8211; Add a Pop Account.<br />
addservlets &#8211; Add JSP support to an account (requires tomcat).<br />
addstatus &#8211; (Internal use never called by user).<br />
adduser &#8211; Add a user to the system.<br />
admin &#8211; Run WHM Lite.<br />
apachelimits &#8211; Add rlimits to Apache<br />
betaexim &#8211; Installs the latest version of exim.<br />
biglogcheck &#8211; looks for logs nearing 2 gigabytes in size<br />
bsdcryptoinstall &#8211; Installs crypto on FreeBSD.<br />
bsdldconfig &#8211; Configures the proper lib directories in FreeBSD.<br />
bsdpkgpingtest &#8211; Tests the connection speed for downloading FreeBSD packages.<br />
buildbsdexpect &#8211; Install expect on FreeBSD.<br />
buildeximconf &#8211; Rebuilds exim.conf.<br />
buildpostgrebsd-dev &#8211; Installs postgresql on FreeBSD.<br />
checkbadconf &#8211; Checks /usr/local/apache/conf/httpd.conf for bad users.<br />
checkbsdgroups &#8211; Checks and repairs proftpd ownership on FreeBSD.<br />
checkccompiler &#8211; Checks to make sure the C compiler works on your system.<br />
checkfpkey &#8211; Checks for the FrontPage suid key<br />
checkgd &#8211; Checks to see if GD is built.<br />
checkinterchange &#8211; (Internal use).<br />
checklibssl &#8211; Checks to make sure the proper libssl symlinks exist.<br />
checkmaxclients &#8211; Checks to see if apache has reached the maximum clients allowed.<br />
checkoldperl &#8211; Checks to see if the version of Perl on your system is old.<br />
checkrsync &#8211; Checks to make sure rsync is up to date.<br />
checksuexecpatch &#8211; Checks to see if mailman has been patched for suexec.<br />
checksuspendpages &#8211; Checks to see if suspend pages are properly named.<br />
checkup2date &#8211; Makes sure up2date is set up properly (RedHat)<br />
checkyum &#8211; Makes sure yum is set up properly.<br />
chkpaths &#8211; Makes sure /usr/sbin/chown has a symlink to /bin/chown<br />
chownpublichtmls &#8211; Change ownership of all users web space to them, which is useful for converting to suexec. Files owned by nobody are deleted.<br />
chpass &#8211; Change password.<br />
ckillall &#8211; Allows you to kill a process (used like killall).<br />
ckillall2 &#8211; Allows you to kill a process.<br />
cleanbw &#8211; Cleans up old bandwidth logs.<br />
cleandns8 &#8211; Clean up named.conf.<br />
cleangd &#8211; Cleans up old GD installs and reinstalls GD<br />
cleanmd5 &#8211; Fix CPAN md5 problems.<br />
cleanmsglog &#8211; cleans exim’s msglog<br />
cleanupmysqlprivs &#8211; Cleans up improper mySQL privileges.<br />
compilers &#8211; Disables the usage of compilers for unprivileged users.<br />
convert2maildir &#8211; Converts mail from mbox to maildir format and installs courier impap and pop (cpimap is removed).<br />
courierup &#8211; Updates/Installs Courier<br />
cpbackup &#8211; Runs backups.<br />
distupgrade &#8211; Upgrades RedHat to the newest version (for testing only)<br />
dnscluster &#8211; Enables DNS clustering.<br />
dnsqueuecron &#8211; Adds a cron job to dump the DNS queue.<br />
dnstransfer &#8211; Only if the server has a DNS master (sync with DNS master).<br />
downgradefp &#8211; Downgrades FrontPage Extensions (to 5.0-0)<br />
dropmysqldb &#8211; Drops a mySQL database.<br />
easyapache &#8211; Upgrade Apache<br />
editquota &#8211; Change a users quota.<br />
enablechkservdwebmail &#8211; Enable service checking of webmaild.<br />
enablefileprotect &#8211; Protects home directories if file protection is built in apache.<br />
ensurepkg &#8211; Installs a FreeBSD package.<br />
ensurerpm &#8211; Installs a rpm.<br />
exim3 &#8211; Installs exim 3.<br />
exim4 &#8211; Installs exim 4.<br />
exim4-rh73test &#8211; Installs exim release #260. (RedHat only)<br />
eximcron &#8211; Creates a cron job for exim_tidy_db.<br />
eximlocalsend &#8211; Enables/Disables exim local sending.<br />
exim_tidydb &#8211; Cleans the exim message log.<br />
eximup &#8211; Installs/Updates exim.<br />
fetchgd &#8211; Includes libg.so.<br />
findhacks &#8211; Search for common Trojan Horses.<br />
findoddrootprocesses &#8211; Lists root processes that may need to be checked out.<br />
findphpversion &#8211; Check to see if your php version file is up to date.<br />
findtrojans &#8211; Exhaustive Trojan Horse search.<br />
fixallcartswithsuexec &#8211; Fixes permissions on carts when using suexec.<br />
fixallinterchangeperm &#8211; Fixes permissions on all users’ Interchange Shopping Carts.<br />
fixbinpath &#8211; Makes sure all bin file paths are correct.<br />
fixbuggynamed &#8211; Updates bind to solve any problems with bugs.<br />
fixcommonproblems &#8211; Attempt to fix the most common problems.<br />
fixetchosts &#8211; Fixes problems with /etc/hosts<br />
fixeverything &#8211; Fix common problems and quotas.<br />
fixfpwml &#8211; Fix for .wml errors with frontpage.<br />
fixheaders &#8211; Run if nothing compiles errors with .h files on compile.<br />
fixinterchange &#8211; Reinstall interchange Perl modules.<br />
fixinterchangeperm &#8211; fix permissions on a user’s interchange cart.<br />
fixipsnm &#8211; Same as addnetmask ips, but Perl though.<br />
fixlibnet &#8211; Reinstall Bundle::libnet (Perl).<br />
fixlocalhostwithphp &#8211; Change /etc/hosts to work better with PHP 4.2.0 + MySQL.<br />
fixmailman &#8211; Updates and restarts mailman.<br />
fixmailmanwithsuexec -<br />
fixmuse &#8211; Reinstalls muse.<br />
fixmysql &#8211; Fixes problems with mySQL.<br />
fixmysqlbsd &#8211; Fixes problesm with mySQL on FreeBSD.<br />
fixnamed &#8211; Updates bind to handle many DNS zones (more than 512).<br />
fixndc &#8211; Repair redhat’s broken named.conf on 7.2.<br />
fixoldlistswithsuexec &#8211; Run after enabling suexec on the server to change the URLs that Mailman gives out to ones that don’t give a 500 internal server error.<br />
fixperl &#8211; Symlink /usr/local/bin/perl /usr/bin/perl.<br />
fixperlscript &#8211; Makes sure a perlscript includes all corresponding modules.<br />
fixpop &#8211; Fix a POP account and reset password.<br />
fixproftpdconf &#8211; Fixes problems with /usr/local/etc/proftpd.conf<br />
fixproftpddupes &#8211; Updates proftpd.<br />
fixquotas &#8211; Fix quotas.<br />
fixrndc &#8211; Fixes named.conf to prevent rndc staus failed.<br />
fixspamassassinfailedupdate &#8211; Reinstalls a failed spamassassin update.<br />
fixsubdomainlogs &#8211; Run if subdomain logs don’t show up in cPanel.<br />
fixsuexeccgiscripts &#8211; Fix CGI scripts that are broken after suexec installed.<br />
fixvaliases &#8211; Fix permisions on valiases.<br />
fixwebalizer &#8211; Repair a Webalizer that has stopped updating.<br />
fp3 &#8211; Updates the fpexe3 patch.<br />
fpanonuserpatch &#8211; Updates FrontPage extensions to include the anonymous user patch.<br />
ftpcheck &#8211; Checks for FTPSSL.<br />
ftpquaotacheck &#8211; Runs quota checking for all ftp users.<br />
ftpup &#8211; Updates your ftp server.<br />
fullhordereset &#8211; Resets Horde and displays the current Horde password.<br />
futexfix &#8211; Fixes problesm with futex.<br />
futexstartup &#8211; Starts futex.<br />
gcc3 &#8211; Installs gcc-3.3.3<br />
gencrt &#8211; Generate a .crt and .csr file.<br />
grpck &#8211; Checks to see if grpck is working properly.<br />
hdparmify &#8211; Enable dma/irq/32bit HD access, which speeds up IDE drives.<br />
hdparmon &#8211; Turns on hdparm.<br />
initacls &#8211; Mounts your file systems with ACL support (make sure your kernel supports ACLs)<br />
initfpsuexec &#8211; Enable FrontPage suexec support.<br />
initquotas &#8211; Turn on quota support on new drives.<br />
initsslhttpd &#8211; Make sure HTTP starts with SSL.<br />
initsuexec &#8211; Turn on suexec support if suexec is installed.<br />
installcgipm &#8211; Installs CGI.pm<br />
installdbi &#8211; Install Bundle::DBD::mysql.<br />
installfpfreebsd &#8211; Installs FrontPage 5 Extensions on FreeBSD.<br />
installfpgentoo &#8211; Installs FrontPage on Gentoo.<br />
installgd &#8211; Builds GD.<br />
installpkg &#8211; Installs a FreeBSD package.<br />
installpostgres &#8211; Installs PostrgeSQL.<br />
installrpm &#8211; Installs a rpm.<br />
installspam &#8211; Install SpamAssassin.<br />
installssl &#8211; Add a SSL vhost.<br />
installzendopt &#8211; Install zend optimzer.<br />
installzendopt-freebsd &#8211; Install zend optimizer on a freebsd machine.<br />
isdedicatedip &#8211; Checks an ip to see if it is dedicated.<br />
killacct &#8211; Delete an account.<br />
killbadrpms &#8211; Security script that kills insecure RPMs from the server.<br />
killdns &#8211; Delete a DNS zone.<br />
killdrrootvhost &#8211; Removes the document root for a virtual host.<br />
killndbm &#8211; Remove the broken NDBM_File module from 7.2.<br />
killpvhost &#8211; Removes a virtual host from proftpd.conf.<br />
killspamkeys &#8211; Removes a spam key.<br />
killsslvhost &#8211; Removes a SSL entry for a virtual host.<br />
killvhost &#8211; Delete a vhost.<br />
listcheck &#8211; Checks mailing lists for issues.<br />
listproblems &#8211; Lists common problems.<br />
listsubdomains &#8211; List subdomains.<br />
mailperm &#8211; Fix almost any mail permission problem.<br />
mailscannerupdate &#8211; Updates MailScanner<br />
mailtroubleshoot &#8211; Guided mail fix.<br />
makecpphp &#8211; Installs php.<br />
makesecondary &#8211; Part of DNS transfer.<br />
manualupcp &#8211; Updates cPanel manually.<br />
md5crypt &#8211; Encrypts a password into MD5.<br />
mseclocal &#8211; Sets up Mandrake’s msec to allow exim to run as mailnull.<br />
mysqladduserdb &#8211; Create a MySQL databse and user.<br />
mysqlconnectioncheck &#8211; Attempts to connect to MySQL, restarts SQL if necessary.<br />
mysqldeluserdb &#8211; Delete a MySQL database and user.<br />
mysqlpasswd &#8211; Change MySQL password.<br />
mysqlrpmpingtest &#8211; Checks your connection speed for downloading mySQL rpms.<br />
mysqlup &#8211; Updates mySQL.<br />
ndbmcheck &#8211; Checks to see if the nbdm module is loaded (kills in RedHat 7.2)<br />
netftpsslpatch &#8211; Patches FTPSSL.pm.<br />
newexim &#8211; Installs the latest version of exim.<br />
nofsck &#8211; Make fsck always use -y<br />
nomodattach &#8211; Removes mod_attach from httpd.conf.<br />
nomodauthmysql -Removes mod_auth_mysql from httpd.conf.<br />
nomodbwprotect &#8211; Removes mod_bwportect from httpd.conf.<br />
nomodgzipconfmods &#8211; Removes mod_gzip from httpd.conf.<br />
nomodperl &#8211; Removes mod_perl from httpd.conf.<br />
oldaddoncgi2xaddon &#8211; Updates old addons to X addons.<br />
park &#8211; Parks a domain.<br />
patcheximconf &#8211; Fixes exim.conf.<br />
perlinstaller &#8211; Installs perl.<br />
phpini &#8211; Create a php.ini file.<br />
pingtest &#8211; Checks your download time from cPanel mirrors.<br />
pkgaccount-ala &#8211; backs up an Alab*nza account for transfer.<br />
pkgacct-ciXost &#8211; backs up a ci*ost account for transfer.<br />
pkgacct-dXm &#8211; backs up a d*m account for transfer.<br />
pkgacct-enXim &#8211; backs up an en*im account for transfer.<br />
pkgacct-pXa &#8211; backs up a p*a account for transfer.<br />
proftpd128 &#8211; Installs proftpd-1.2.8.<br />
ptycheck &#8211; Fixes permissoins on /dev/ptmx.<br />
pwck -Verifies the integrity of system authentication information.<br />
quickkernel &#8211; Updates your kernel.<br />
quicksecure &#8211; Quickly kill useless services.<br />
rebuildcpanelsslcrt &#8211; Rebuilds the cPanel SSL Certificate.<br />
rebuildcpusers &#8211; Rebuilds /var/cpanel/users.<br />
rebuildetcpasswd &#8211; Rebuilds /etc/passwd.<br />
rebuildeximbsd &#8211; Rebuilds exim on FreeBSD.<br />
rebuildhttpdconffromproftpd &#8211; Rebuild httpd.conf from the proftpd.conf file.<br />
rebuildinterchangecfg &#8211; Used after moving a domain with Interchange to the server.<br />
rebuildnamedconf &#8211; Restore named.conf from files in /var/named.<br />
rebuildproftpd &#8211; Restore proftpd.conf from httpd.conf.<br />
reinstallmailman &#8211; Reinstalls mailman.<br />
relocatevartousr &#8211; Relocates files from /var to /usr in case of disk space issues.<br />
remdefssl &#8211; Remove default SSL vhost.<br />
reseteximtodefaults &#8211; Resets exim’s default settings.<br />
resetimappasswds &#8211; Resets all imap passwords.adddns &#8211; Adds a DNS zone.<br />
addfpmail &#8211; Add frontpage mail extensions to all domains without them.<br />
addfpmail2 -Add frontpage mail extensions to all domains without them.<br />
addnetmaskips &#8211; Add the netmask 255.255.255.0 to all IPs that have no netmask.<br />
addnobodygrp &#8211; Adds the group nobody and activates security.<br />
addpop &#8211; Add a Pop Account.<br />
addservlets &#8211; Add JSP support to an account (requires tomcat).<br />
addstatus &#8211; (Internal use never called by user).<br />
adduser &#8211; Add a user to the system.<br />
admin &#8211; Run WHM Lite.<br />
apachelimits &#8211; Add rlimits to Apache<br />
betaexim &#8211; Installs the latest version of exim.<br />
biglogcheck &#8211; looks for logs nearing 2 gigabytes in size<br />
bsdcryptoinstall &#8211; Installs crypto on FreeBSD.<br />
bsdldconfig &#8211; Configures the proper lib directories in FreeBSD.<br />
bsdpkgpingtest &#8211; Tests the connection speed for downloading FreeBSD packages.<br />
buildbsdexpect &#8211; Install expect on FreeBSD.<br />
buildeximconf &#8211; Rebuilds exim.conf.<br />
buildpostgrebsd-dev &#8211; Installs postgresql on FreeBSD.<br />
checkbadconf &#8211; Checks /usr/local/apache/conf/httpd.conf for bad users.<br />
checkbsdgroups &#8211; Checks and repairs proftpd ownership on FreeBSD.<br />
checkccompiler &#8211; Checks to make sure the C compiler works on your system.<br />
checkfpkey &#8211; Checks for the FrontPage suid key<br />
checkgd &#8211; Checks to see if GD is built.<br />
checkinterchange &#8211; (Internal use).<br />
checklibssl &#8211; Checks to make sure the proper libssl symlinks exist.<br />
checkmaxclients &#8211; Checks to see if apache has reached the maximum clients allowed.<br />
checkoldperl &#8211; Checks to see if the version of Perl on your system is old.<br />
checkrsync &#8211; Checks to make sure rsync is up to date.<br />
checksuexecpatch &#8211; Checks to see if mailman has been patched for suexec.<br />
checksuspendpages &#8211; Checks to see if suspend pages are properly named.<br />
checkup2date &#8211; Makes sure up2date is set up properly (RedHat)<br />
checkyum &#8211; Makes sure yum is set up properly.<br />
chkpaths &#8211; Makes sure /usr/sbin/chown has a symlink to /bin/chown<br />
chownpublichtmls &#8211; Change ownership of all users web space to them, which is useful for converting to suexec. Files owned by nobody are deleted.<br />
chpass &#8211; Change password.<br />
ckillall &#8211; Allows you to kill a process (used like killall).<br />
ckillall2 &#8211; Allows you to kill a process.<br />
cleanbw &#8211; Cleans up old bandwidth logs.<br />
cleandns8 &#8211; Clean up named.conf.<br />
cleangd &#8211; Cleans up old GD installs and reinstalls GD<br />
cleanmd5 &#8211; Fix CPAN md5 problems.<br />
cleanmsglog &#8211; cleans exim’s msglog<br />
cleanupmysqlprivs &#8211; Cleans up improper mySQL privileges.<br />
compilers &#8211; Disables the usage of compilers for unprivileged users.<br />
convert2maildir &#8211; Converts mail from mbox to maildir format and installs courier impap and pop (cpimap is removed).<br />
courierup &#8211; Updates/Installs Courier<br />
cpbackup &#8211; Runs backups.<br />
distupgrade &#8211; Upgrades RedHat to the newest version (for testing only)<br />
dnscluster &#8211; Enables DNS clustering.<br />
dnsqueuecron &#8211; Adds a cron job to dump the DNS queue.<br />
dnstransfer &#8211; Only if the server has a DNS master (sync with DNS master).<br />
downgradefp &#8211; Downgrades FrontPage Extensions (to 5.0-0)<br />
dropmysqldb &#8211; Drops a mySQL database.<br />
easyapache &#8211; Upgrade Apache<br />
editquota &#8211; Change a users quota.<br />
enablechkservdwebmail &#8211; Enable service checking of webmaild.<br />
enablefileprotect &#8211; Protects home directories if file protection is built in apache.<br />
ensurepkg &#8211; Installs a FreeBSD package.<br />
ensurerpm &#8211; Installs a rpm.<br />
exim3 &#8211; Installs exim 3.<br />
exim4 &#8211; Installs exim 4.<br />
exim4-rh73test &#8211; Installs exim release #260. (RedHat only)<br />
eximcron &#8211; Creates a cron job for exim_tidy_db.<br />
eximlocalsend &#8211; Enables/Disables exim local sending.<br />
exim_tidydb &#8211; Cleans the exim message log.<br />
eximup &#8211; Installs/Updates exim.<br />
fetchgd &#8211; Includes libg.so.<br />
findhacks &#8211; Search for common Trojan Horses.<br />
findoddrootprocesses &#8211; Lists root processes that may need to be checked out.<br />
findphpversion &#8211; Check to see if your php version file is up to date.<br />
findtrojans &#8211; Exhaustive Trojan Horse search.<br />
fixallcartswithsuexec &#8211; Fixes permissions on carts when using suexec.<br />
fixallinterchangeperm &#8211; Fixes permissions on all users’ Interchange Shopping Carts.<br />
fixbinpath &#8211; Makes sure all bin file paths are correct.<br />
fixbuggynamed &#8211; Updates bind to solve any problems with bugs.<br />
fixcommonproblems &#8211; Attempt to fix the most common problems.<br />
fixetchosts &#8211; Fixes problems with /etc/hosts<br />
fixeverything &#8211; Fix common problems and quotas.<br />
fixfpwml &#8211; Fix for .wml errors with frontpage.<br />
fixheaders &#8211; Run if nothing compiles errors with .h files on compile.<br />
fixinterchange &#8211; Reinstall interchange Perl modules.<br />
fixinterchangeperm &#8211; fix permissions on a user’s interchange cart.<br />
fixipsnm &#8211; Same as addnetmask ips, but Perl though.<br />
fixlibnet &#8211; Reinstall Bundle::libnet (Perl).<br />
fixlocalhostwithphp &#8211; Change /etc/hosts to work better with PHP 4.2.0 + MySQL.<br />
fixmailman &#8211; Updates and restarts mailman.<br />
fixmailmanwithsuexec -<br />
fixmuse &#8211; Reinstalls muse.<br />
fixmysql &#8211; Fixes problems with mySQL.<br />
fixmysqlbsd &#8211; Fixes problesm with mySQL on FreeBSD.<br />
fixnamed &#8211; Updates bind to handle many DNS zones (more than 512).<br />
fixndc &#8211; Repair redhat’s broken named.conf on 7.2.<br />
fixoldlistswithsuexec &#8211; Run after enabling suexec on the server to change the URLs that Mailman gives out to ones that don’t give a 500 internal server error.<br />
fixperl &#8211; Symlink /usr/local/bin/perl /usr/bin/perl.<br />
fixperlscript &#8211; Makes sure a perlscript includes all corresponding modules.<br />
fixpop &#8211; Fix a POP account and reset password.<br />
fixproftpdconf &#8211; Fixes problems with /usr/local/etc/proftpd.conf<br />
fixproftpddupes &#8211; Updates proftpd.<br />
fixquotas &#8211; Fix quotas.<br />
fixrndc &#8211; Fixes named.conf to prevent rndc staus failed.<br />
fixspamassassinfailedupdate &#8211; Reinstalls a failed spamassassin update.<br />
fixsubdomainlogs &#8211; Run if subdomain logs don’t show up in cPanel.<br />
fixsuexeccgiscripts &#8211; Fix CGI scripts that are broken after suexec installed.<br />
fixvaliases &#8211; Fix permisions on valiases.<br />
fixwebalizer &#8211; Repair a Webalizer that has stopped updating.<br />
fp3 &#8211; Updates the fpexe3 patch.<br />
fpanonuserpatch &#8211; Updates FrontPage extensions to include the anonymous user patch.<br />
ftpcheck &#8211; Checks for FTPSSL.<br />
ftpquaotacheck &#8211; Runs quota checking for all ftp users.<br />
ftpup &#8211; Updates your ftp server.<br />
fullhordereset &#8211; Resets Horde and displays the current Horde password.<br />
futexfix &#8211; Fixes problesm with futex.<br />
futexstartup &#8211; Starts futex.<br />
gcc3 &#8211; Installs gcc-3.3.3<br />
gencrt &#8211; Generate a .crt and .csr file.<br />
grpck &#8211; Checks to see if grpck is working properly.<br />
hdparmify &#8211; Enable dma/irq/32bit HD access, which speeds up IDE drives.<br />
hdparmon &#8211; Turns on hdparm.<br />
initacls &#8211; Mounts your file systems with ACL support (make sure your kernel supports ACLs)<br />
initfpsuexec &#8211; Enable FrontPage suexec support.<br />
initquotas &#8211; Turn on quota support on new drives.<br />
initsslhttpd &#8211; Make sure HTTP starts with SSL.<br />
initsuexec &#8211; Turn on suexec support if suexec is installed.<br />
installcgipm &#8211; Installs CGI.pm<br />
installdbi &#8211; Install Bundle::DBD::mysql.<br />
installfpfreebsd &#8211; Installs FrontPage 5 Extensions on FreeBSD.<br />
installfpgentoo &#8211; Installs FrontPage on Gentoo.<br />
installgd &#8211; Builds GD.<br />
installpkg &#8211; Installs a FreeBSD package.<br />
installpostgres &#8211; Installs PostrgeSQL.<br />
installrpm &#8211; Installs a rpm.<br />
installspam &#8211; Install SpamAssassin.<br />
installssl &#8211; Add a SSL vhost.<br />
installzendopt &#8211; Install zend optimzer.<br />
installzendopt-freebsd &#8211; Install zend optimizer on a freebsd machine.<br />
isdedicatedip &#8211; Checks an ip to see if it is dedicated.<br />
killacct &#8211; Delete an account.<br />
killbadrpms &#8211; Security script that kills insecure RPMs from the server.<br />
killdns &#8211; Delete a DNS zone.<br />
killdrrootvhost &#8211; Removes the document root for a virtual host.<br />
killndbm &#8211; Remove the broken NDBM_File module from 7.2.<br />
killpvhost &#8211; Removes a virtual host from proftpd.conf.<br />
killspamkeys &#8211; Removes a spam key.<br />
killsslvhost &#8211; Removes a SSL entry for a virtual host.<br />
killvhost &#8211; Delete a vhost.<br />
listcheck &#8211; Checks mailing lists for issues.<br />
listproblems &#8211; Lists common problems.<br />
listsubdomains &#8211; List subdomains.<br />
mailperm &#8211; Fix almost any mail permission problem.<br />
mailscannerupdate &#8211; Updates MailScanner<br />
mailtroubleshoot &#8211; Guided mail fix.<br />
makecpphp &#8211; Installs php.<br />
makesecondary &#8211; Part of DNS transfer.<br />
manualupcp &#8211; Updates cPanel manually.<br />
md5crypt &#8211; Encrypts a password into MD5.<br />
mseclocal &#8211; Sets up Mandrake’s msec to allow exim to run as mailnull.<br />
mysqladduserdb &#8211; Create a MySQL databse and user.<br />
mysqlconnectioncheck &#8211; Attempts to connect to MySQL, restarts SQL if necessary.<br />
mysqldeluserdb &#8211; Delete a MySQL database and user.<br />
mysqlpasswd &#8211; Change MySQL password.<br />
mysqlrpmpingtest &#8211; Checks your connection speed for downloading mySQL rpms.<br />
mysqlup &#8211; Updates mySQL.<br />
ndbmcheck &#8211; Checks to see if the nbdm module is loaded (kills in RedHat 7.2)<br />
netftpsslpatch &#8211; Patches FTPSSL.pm.<br />
newexim &#8211; Installs the latest version of exim.<br />
nofsck &#8211; Make fsck always use -y<br />
nomodattach &#8211; Removes mod_attach from httpd.conf.<br />
nomodauthmysql -Removes mod_auth_mysql from httpd.conf.<br />
nomodbwprotect &#8211; Removes mod_bwportect from httpd.conf.<br />
nomodgzipconfmods &#8211; Removes mod_gzip from httpd.conf.<br />
nomodperl &#8211; Removes mod_perl from httpd.conf.<br />
oldaddoncgi2xaddon &#8211; Updates old addons to X addons.<br />
park &#8211; Parks a domain.<br />
patcheximconf &#8211; Fixes exim.conf.<br />
perlinstaller &#8211; Installs perl.<br />
phpini &#8211; Create a php.ini file.<br />
pingtest &#8211; Checks your download time from cPanel mirrors.<br />
pkgaccount-ala &#8211; backs up an Alab*nza account for transfer.<br />
pkgacct-ciXost &#8211; backs up a ci*ost account for transfer.<br />
pkgacct-dXm &#8211; backs up a d*m account for transfer.<br />
pkgacct-enXim &#8211; backs up an en*im account for transfer.<br />
pkgacct-pXa &#8211; backs up a p*a account for transfer.<br />
proftpd128 &#8211; Installs proftpd-1.2.8.<br />
ptycheck &#8211; Fixes permissoins on /dev/ptmx.<br />
pwck -Verifies the integrity of system authentication information.<br />
quickkernel &#8211; Updates your kernel.<br />
quicksecure &#8211; Quickly kill useless services.<br />
rebuildcpanelsslcrt &#8211; Rebuilds the cPanel SSL Certificate.<br />
rebuildcpusers &#8211; Rebuilds /var/cpanel/users.<br />
rebuildetcpasswd &#8211; Rebuilds /etc/passwd.<br />
rebuildeximbsd &#8211; Rebuilds exim on FreeBSD.<br />
rebuildhttpdconffromproftpd &#8211; Rebuild httpd.conf from the proftpd.conf file.<br />
rebuildinterchangecfg &#8211; Used after moving a domain with Interchange to the server.<br />
rebuildnamedconf &#8211; Restore named.conf from files in /var/named.<br />
rebuildproftpd &#8211; Restore proftpd.conf from httpd.conf.<br />
reinstallmailman &#8211; Reinstalls mailman.<br />
relocatevartousr &#8211; Relocates files from /var to /usr in case of disk space issues.<br />
remdefssl &#8211; Remove default SSL vhost.<br />
reseteximtodefaults &#8211; Resets exim’s default settings.<br />
resetimappasswds &#8211; Resets all imap passwords.<br />
resetquotas &#8211; Change quotas to what they should be .<br />
restartsrv &#8211; Restart a service.<br />
restartsrv_apache &#8211; Restart apache.<br />
restartsrv_bind &#8211; Restart bind.<br />
restartsrv_clamd &#8211; Restart clamd.<br />
restartsrv_courier &#8211; Restart courier imap.<br />
restartsrv_cppop &#8211; Restart cppop.<br />
restartsrv_entropychat &#8211; Restart entropy chat.<br />
restartsrv_exim &#8211; Restart exim.<br />
restartsrv_eximstats &#8211; Restart exim statistics.<br />
restartsrv_ftpserver &#8211; Restart your ftp server.<br />
restartsrv_httpd &#8211; Restart httpd.<br />
restartsrv_imap &#8211; Restart impad.<br />
restartsrv_inetd &#8211; Restart inetd.<br />
restartsrv_interchange &#8211; Restart Interchange Shopping Cart.<br />
restartsrv_melange &#8211; Restart melange chat.<br />
restartsrv_mysql &#8211; Restart mysqld.<br />
restartsrv_named &#8211; Restart named.<br />
restartsrv_postgres &#8211; Restart postgresql.<br />
restartsrv_postgresql &#8211; Restart postgresql.<br />
restartsrv_proftpd &#8211; Restart proftpd.<br />
restartsrv_pureftpd &#8211; Restart pure-ftpd.<br />
restartsrv_spamd &#8211; Restart spamd.<br />
restartsrv_sshd &#8211; Restart sshd.<br />
restartsrv_syslogd &#8211; Restart syslogd.<br />
restartsrv_tomcat &#8211; Restart tomcat.<br />
restartsrv_xinetd &#8211; Restart xinetd.<br />
restoremail &#8211; Restores a user’s mail.<br />
reswhostmgr &#8211; Restart whostmgr.<br />
rpmup &#8211; Upgrade redhat/mandrake errata/security.<br />
rrdtoolinstall &#8211; Installs RRD Tool.<br />
runstatsonce &#8211; Runs statistics (should be used from the crontab).<br />
runweblogs &#8211; Run analog/webalizer/etc. for a user.<br />
safeperlinstaller &#8211; Installs perl safely.<br />
safeup2date &#8211; Runs up2date safely.<br />
safeyum &#8211; Runs yum safely.<br />
secureit &#8211; Remove unnecessary suid binaries.<br />
securemysql &#8211; Attempts to secure the MySQL configuration.<br />
securetmp &#8211; Adds securetmp to system startup.<br />
setupfp &#8211; Install FrontPage 3 on an account.<br />
setupfp4 &#8211; Install FrontPage 4 (2000) installer on an account.<br />
setupfp5 &#8211; Install FrontPage 5 (2002) installer on an account.<br />
setupfp5.nosueuxec &#8211; Install FrontPage 5 (2002) installer on an account when not using suexec.<br />
showexelist &#8211; Shows exe processes.<br />
simpleps &#8211; Display the process list.<br />
smartcheck &#8211; Checks hard drive integrity.<br />
smtpmailgdionly &#8211; Enables SMTP Mail Protection.<br />
spamboxdisable &#8211; Disables SpamAssassin’s spambox delivehttp://instacarma.com/blog/technical/useful-cpanel-scripts-and-their-functions/ry for all accounts.<br />
suspendacct &#8211; Suspends an account.<br />
sysup &#8211; update cPanel RPMs.<br />
unlimitnamed &#8211; Installs the latest version of bind patched to support greater than 512 ips on the server.<br />
unblockip &#8211; Unblocks an IP blocked by portsentry.<br />
unsetupfp4 &#8211; Removes FrontPage 4 or 5 from an account.<br />
unslavenamedconf &#8211; If the user accidentally sets a DNS master as local server, this will repair named.conf after the loop.<br />
unsuspendacct &#8211; Unsuspends an account.<br />
upcp &#8211; Updates cPanel.<br />
updated &#8211; Updates /scripts.<br />
updatefrontpage &#8211; Updates FrontPage<br />
updatenow &#8211; Updates /scripts NOW.<br />
updatephpconf &#8211; Updates PHP configuration files.<br />
whoowns &#8211; Finds out who owns a domain.http://instacarma.com/blog/technical/useful-cpanel-scripts-and-their-functions/<br />
wwwacct &#8211; Creates an account.<br />
xaddonreport &#8211; Reports the current addon scripts installed.<br />
resetquotas &#8211; Change quotas to what they should be .<br />
restartsrv &#8211; Restart a service.<br />
restartsrv_apache &#8211; Restart apache.<br />
restartsrv_bind &#8211; Restart bind.<br />
restartsrv_clamd &#8211; Restart clamd.<br />
restartsrv_courier &#8211; Restart courier imap.<br />
restartsrv_cppop &#8211; Restart cppop.<br />
restartsrv_entropychat &#8211; Restart entropy chat.<br />
restartsrv_exim &#8211; Restart exim.<br />
restartsrv_eximstats &#8211; Restart exim statistics.<br />
restartsrv_ftpserver &#8211; Restart your ftp server.<br />
restartsrv_httpd &#8211; Restart httpd.<br />
restartsrv_imap &#8211; Restart impad.<br />
restartsrv_inetd &#8211; Restart inetd.<br />
restartsrv_interchange &#8211; Restart Interchange Shopping Cart.<br />
restartsrv_melange &#8211; Restart melange chat.<br />
restartsrv_mysql &#8211; Restart mysqld.<br />
restartsrv_named &#8211; Restart named.<br />
restartsrv_postgres &#8211; Restart postgresql.<br />
restartsrv_postgresql &#8211; Restart postgresql.<br />
restartsrv_proftpd &#8211; Restart proftpd.<br />
restartsrv_pureftpd &#8211; Restart pure-ftpd.<br />
restartsrv_spamd &#8211; Restart spamd.<br />
restartsrv_sshd &#8211; Restart sshd.<br />
restartsrv_syslogd &#8211; Restart syslogd.<br />
restartsrv_tomcat &#8211; Restart tomcat.<br />
restartsrv_xinetd &#8211; Restart xinetd.<br />
restoremail &#8211; Restores a user’s mail.<br />
reswhostmgr &#8211; Restart whostmgr.<br />
rpmup &#8211; Upgrade redhat/mandrake errata/security.<br />
rrdtoolinstall &#8211; Installs RRD Tool.<br />
runstatsonce &#8211; Runs statistics (should be used from the crontab).<br />
runweblogs &#8211; Run analog/webalizer/etc. for a user.<br />
safeperlinstaller &#8211; Installs perl safely.<br />
safeup2date &#8211; Runs up2date safely.<br />
safeyum &#8211; Runs yum safely.<br />
secureit &#8211; Remove unnecessary suid binaries.<br />
securemysql &#8211; Attempts to secure the MySQL configuration.<br />
securetmp &#8211; Adds securetmp to system startup.<br />
setupfp &#8211; Install FrontPage 3 on an account.<br />
setupfp4 &#8211; Install FrontPage 4 (2000) installer on an account.<br />
setupfp5 &#8211; Install FrontPage 5 (2002) installer on an account.<br />
setupfp5.nosueuxec &#8211; Install FrontPage 5 (2002) installer on an account when not using suexec.<br />
showexelist &#8211; Shows exe processes.<br />
simpleps &#8211; Display the process list.<br />
smartcheck &#8211; Checks hard drive integrity.<br />
smtpmailgdionly &#8211; Enables SMTP Mail Protection.<br />
spamboxdisable &#8211; Disables SpamAssassin’s spambox delivery for all accounts.<br />
suspendacct &#8211; Suspends an account.<br />
sysup &#8211; update cPanel RPMs.<br />
unlimitnamed &#8211; Installs the latest version of bind patched to support greater than 512 ips on the server.<br />
unblockip &#8211; Unblocks an IP blocked by portsentry.<br />
unsetupfp4 &#8211; Removes FrontPage 4 or 5 from an account.<br />
unslavenamedconf &#8211; If the user accidentally sets a DNS master as local server, this will repair named.conf after the loop.<br />
unsuspendacct &#8211; Unsuspends an account.<br />
upcp &#8211; Updates cPanel.<br />
updated &#8211; Updates /scripts.<br />
updatefrontpage &#8211; Updates FrontPage<br />
updatenow &#8211; Updates /scripts NOW.<br />
updatephpconf &#8211; Updates PHP configuration files.<br />
whoowns &#8211; Finds out who owns a domain.<br />
wwwacct &#8211; Creates an account.<br />
xaddonreport &#8211; Reports the current addon scripts installed.<br />
addservlets &#8211; Add JSP support to an account (requires tomcat).<br />
addstatus &#8211; (Internal use never called by user).<br />
adduser &#8211; Add a user to the system.<br />
admin &#8211; Run WHM Lite.<br />
apachelimits &#8211; Add rlimits to Apache<br />
betaexim &#8211; Installs the latest version of exim.<br />
biglogcheck &#8211; looks for logs nearing 2 gigabytes in size<br />
bsdcryptoinstall &#8211; Installs crypto on FreeBSD.<br />
bsdldconfig &#8211; Configures the proper lib directories in FreeBSD.<br />
bsdpkgpingtest &#8211; Tests the connection speed for downloading FreeBSD packages.<br />
buildbsdexpect &#8211; Install expect on FreeBSD.<br />
buildeximconf &#8211; Rebuilds exim.conf.<br />
buildpostgrebsd-dev &#8211; Installs postgresql on FreeBSD.<br />
checkbadconf &#8211; Checks /usr/local/apache/conf/httpd.conf for bad users.<br />
checkbsdgroups &#8211; Checks and repairs proftpd ownership on FreeBSD.<br />
checkccompiler &#8211; Checks to make sure the C compiler works on your system.<br />
checkfpkey &#8211; Checks for the FrontPage suid key<br />
checkgd &#8211; Checks to see if GD is built.<br />
checkinterchange &#8211; (Internal use).<br />
checklibssl &#8211; Checks to make sure the proper libssl symlinks exist.<br />
checkmaxclients &#8211; Checks to see if apache has reached the maximum clients allowed.<br />
checkoldperl &#8211; Checks to see if the version of Perl on your system is old.<br />
checkrsync &#8211; Checks to make sure rsync is up to date.<br />
checksuexecpatch &#8211; Checks to see if mailman has been patched for suexec.<br />
checksuspendpages &#8211; Checks to see if suspend pages are properly named.<br />
checkup2date &#8211; Makes sure up2date is set up properly (RedHat)<br />
checkyum &#8211; Makes sure yum is set up properly.<br />
chkpaths &#8211; Makes sure /usr/sbin/chown has a symlink to /bin/chown<br />
chownpublichtmls &#8211; Change ownership of all users web space to them, which is useful for converting to suexec. Files owned by nobody are deleted.<br />
chpass &#8211; Change password.<br />
ckillall &#8211; Allows you to kill a process (used like killall).<br />
ckillall2 &#8211; Allows you to kill a process.<br />
cleanbw &#8211; Cleans up old bandwidth logs.<br />
cleandns8 &#8211; Clean up named.conf.<br />
cleangd &#8211; Cleans up old GD installs and reinstalls GD<br />
cleanmd5 &#8211; Fix CPAN md5 problems.<br />
cleanmsglog &#8211; cleans exim’s msglog<br />
cleanupmysqlprivs &#8211; Cleans up improper mySQL privileges.<br />
compilers &#8211; Disables the usage of compilers for unprivileged users.<br />
convert2maildir &#8211; Converts mail from mbox to maildir format and installs courier impap and pop (cpimap is removed).<br />
courierup &#8211; Updates/Installs Courier<br />
cpbackup &#8211; Runs backups.<br />
distupgrade &#8211; Upgrades RedHat to the newest version (for testing only)<br />
dnscluster &#8211; Enables DNS clustering.<br />
dnsqueuecron &#8211; Adds a cron job to dump the DNS queue.<br />
dnstransfer &#8211; Only if the server has a DNS master (sync with DNS master).<br />
downgradefp &#8211; Downgrades FrontPage Extensions (to 5.0-0)<br />
dropmysqldb &#8211; Drops a mySQL database.<br />
easyapache &#8211; Upgrade Apache<br />
editquota &#8211; Change a users quota.<br />
enablechkservdwebmail &#8211; Enable service checking of webmaild.<br />
enablefileprotect &#8211; Protects home directories if file protection is built in apache.<br />
ensurepkg &#8211; Installs a FreeBSD package.<br />
ensurerpm &#8211; Installs a rpm.<br />
exim3 &#8211; Installs exim 3.<br />
exim4 &#8211; Installs exim 4.<br />
exim4-rh73test &#8211; Installs exim release #260. (RedHat only)<br />
eximcron &#8211; Creates a cron job for exim_tidy_db.<br />
eximlocalsend &#8211; Enables/Disables exim local sending.<br />
exim_tidydb &#8211; Cleans the exim message log.<br />
eximup &#8211; Installs/Updates exim.<br />
fetchgd &#8211; Includes libg.so.<br />
findhacks &#8211; Search for common Trojan Horses.<br />
findoddrootprocesses &#8211; Lists root processes that may need to be checked out.<br />
findphpversion &#8211; Check to see if your php version file is up to date.<br />
findtrojans &#8211; Exhaustive Trojan Horse search.<br />
fixallcartswithsuexec &#8211; Fixes permissions on carts when using suexec.<br />
fixallinterchangeperm &#8211; Fixes permissions on all users’ Interchange Shopping Carts.<br />
fixbinpath &#8211; Makes sure all bin file paths are correct.<br />
fixbuggynamed &#8211; Updates bind to solve any problems with bugs.<br />
fixcommonproblems &#8211; Attempt to fix the most common problems.<br />
fixetchosts &#8211; Fixes problems with /etc/hosts<br />
fixeverything &#8211; Fix common problems and quotas.<br />
fixfpwml &#8211; Fix for .wml errors with frontpage.<br />
fixheaders &#8211; Run if nothing compiles errors with .h files on compile.<br />
fixinterchange &#8211; Reinstall interchange Perl modules.<br />
fixinterchangeperm &#8211; fix permissions on a user’s interchange cart.<br />
fixipsnm &#8211; Same as addnetmask ips, but Perl though.<br />
fixlibnet &#8211; Reinstall Bundle::libnet (Perl).<br />
fixlocalhostwithphp &#8211; Change /etc/hosts to work better with PHP 4.2.0 + MySQL.<br />
fixmailman &#8211; Updates and restarts mailman.<br />
fixmailmanwithsuexec -<br />
fixmuse &#8211; Reinstalls muse.<br />
fixmysql &#8211; Fixes problems with mySQL.<br />
fixmysqlbsd &#8211; Fixes problesm with mySQL on FreeBSD.<br />
fixnamed &#8211; Updates bind to handle many DNS zones (more than 512).<br />
fixndc &#8211; Repair redhat’s broken named.conf on 7.2.<br />
fixoldlistswithsuexec &#8211; Run after enabling suexec on the server to change the URLs that Mailman gives out to ones that don’t give a 500 internal server error.<br />
fixperl &#8211; Symlink /usr/local/bin/perl /usr/bin/perl.<br />
fixperlscript &#8211; Makes sure a perlscript includes all corresponding modules.<br />
fixpop &#8211; Fix a POP account and reset password.<br />
fixproftpdconf &#8211; Fixes problems with /usr/local/etc/proftpd.conf<br />
fixproftpddupes &#8211; Updates proftpd.<br />
fixquotas &#8211; Fix quotas.<br />
fixrndc &#8211; Fixes named.conf to prevent rndc staus failed.<br />
fixspamassassinfailedupdate &#8211; Reinstalls a failed spamassassin update.<br />
fixsubdomainlogs &#8211; Run if subdomain logs don’t show up in cPanel.<br />
fixsuexeccgiscripts &#8211; Fix CGI scripts that are broken after suexec installed.<br />
fixvaliases &#8211; Fix permisions on valiases.<br />
fixwebalizer &#8211; Repair a Webalizer that has stopped updating.<br />
fp3 &#8211; Updates the fpexe3 patch.<br />
fpanonuserpatch &#8211; Updates FrontPage extensions to include the anonymous user patch.<br />
ftpcheck &#8211; Checks for FTPSSL.<br />
ftpquaotacheck &#8211; Runs quota checking for all ftp users.<br />
ftpup &#8211; Updates your ftp server.<br />
fullhordereset &#8211; Resets Horde and displays the current Horde password.<br />
futexfix &#8211; Fixes problesm with futex.<br />
futexstartup &#8211; Starts futex.<br />
gcc3 &#8211; Installs gcc-3.3.3<br />
gencrt &#8211; Generate a .crt and .csr file.<br />
grpck &#8211; Checks to see if grpck is working properly.<br />
hdparmify &#8211; Enable dma/irq/32bit HD access, which speeds up IDE drives.<br />
hdparmon &#8211; Turns on hdparm.<br />
initacls &#8211; Mounts your file systems with ACL support (make sure your kernel supports ACLs)<br />
initfpsuexec &#8211; Enable FrontPage suexec support.<br />
initquotas &#8211; Turn on quota support on new drives.<br />
initsslhttpd &#8211; Make sure HTTP starts with SSL.<br />
initsuexec &#8211; Turn on suexec support if suexec is installed.<br />
installcgipm &#8211; Installs CGI.pm<br />
installdbi &#8211; Install Bundle::DBD::mysql.<br />
installfpfreebsd &#8211; Installs FrontPage 5 Extensions on FreeBSD.<br />
installfpgentoo &#8211; Installs FrontPage on Gentoo.<br />
installgd &#8211; Builds GD.<br />
installpkg &#8211; Installs a FreeBSD package.<br />
installpostgres &#8211; Installs PostrgeSQL.<br />
installrpm &#8211; Installs a rpm.<br />
installspam &#8211; Install SpamAssassin.<br />
installssl &#8211; Add a SSL vhost.<br />
installzendopt &#8211; Install zend optimzer.<br />
installzendopt-freebsd &#8211; Install zend optimizer on a freebsd machine.<br />
isdedicatedip &#8211; Checks an ip to see if it is dedicated.<br />
killacct &#8211; Delete an account.<br />
killbadrpms &#8211; Security script that kills insecure RPMs from the server.<br />
killdns &#8211; Delete a DNS zone.<br />
killdrrootvhost &#8211; Removes the document root for a virtual host.<br />
killndbm &#8211; Remove the broken NDBM_File module from 7.2.<br />
killpvhost &#8211; Removes a virtual host from proftpd.conf.<br />
killspamkeys &#8211; Removes a spam key.<br />
killsslvhost &#8211; Removes a SSL entry for a virtual host.<br />
killvhost &#8211; Delete a vhost.<br />
listcheck &#8211; Checks mailing lists for issues.<br />
listproblems &#8211; Lists common problems.<br />
listsubdomains &#8211; List subdomains.<br />
mailperm &#8211; Fix almost any mail permission problem.<br />
mailscannerupdate &#8211; Updates MailScanner<br />
mailtroubleshoot &#8211; Guided mail fix.<br />
makecpphp &#8211; Installs php.<br />
makesecondary &#8211; Part of DNS transfer.<br />
manualupcp &#8211; Updates cPanel manually.<br />
md5crypt &#8211; Encrypts a password into MD5.<br />
mseclocal &#8211; Sets up Mandrake’s msec to allow exim to run as mailnull.<br />
mysqladduserdb &#8211; Create a MySQL databse and user.<br />
mysqlconnectioncheck &#8211; Attempts to connect to MySQL, restarts SQL if necessary.<br />
mysqldeluserdb &#8211; Delete a MySQL database and user.<br />
mysqlpasswd &#8211; Change MySQL password.<br />
mysqlrpmpingtest &#8211; Checks your connection speed for downloading mySQL rpms.<br />
mysqlup &#8211; Updates mySQL.<br />
ndbmcheck &#8211; Checks to see if the nbdm module is loaded (kills in RedHat 7.2)<br />
netftpsslpatch &#8211; Patches FTPSSL.pm.<br />
newexim &#8211; Installs the latest version of exim.<br />
nofsck &#8211; Make fsck always use -y<br />
nomodattach &#8211; Removes mod_attach from httpd.conf.<br />
nomodauthmysql -Removes mod_auth_mysql from httpd.conf.<br />
nomodbwprotect &#8211; Removes mod_bwportect from httpd.conf.<br />
nomodgzipconfmods &#8211; Removes mod_gzip from httpd.conf.<br />
nomodperl &#8211; Removes mod_perl from httpd.conf.<br />
oldaddoncgi2xaddon &#8211; Updates old addons to X addons.<br />
park &#8211; Parks a domain.<br />
patcheximconf &#8211; Fixes exim.conf.<br />
perlinstaller &#8211; Installs perl.<br />
phpini &#8211; Create a php.ini file.<br />
pingtest &#8211; Checks your download time from cPanel mirrors.<br />
pkgaccount-ala &#8211; backs up an Alab*nza account for transfer.<br />
pkgacct-ciXost &#8211; backs up a ci*ost account for transfer.<br />
pkgacct-dXm &#8211; backs up a d*m account for transfer.<br />
pkgacct-enXim &#8211; backs up an en*im account for transfer.<br />
pkgacct-pXa &#8211; backs up a p*a account for transfer.<br />
proftpd128 &#8211; Installs proftpd-1.2.8.<br />
ptycheck &#8211; Fixes permissoins on /dev/ptmx.<br />
pwck -Verifies the integrity of system authentication information.<br />
quickkernel &#8211; Updates your kernel.<br />
quicksecure &#8211; Quickly kill useless services.<br />
rebuildcpanelsslcrt &#8211; Rebuilds the cPanel SSL Certificate.<br />
rebuildcpusers &#8211; Rebuilds /var/cpanel/users.<br />
rebuildetcpasswd &#8211; Rebuilds /etc/passwd.<br />
rebuildeximbsd &#8211; Rebuilds exim on FreeBSD.<br />
rebuildhttpdconffromproftpd &#8211; Rebuild httpd.conf from the proftpd.conf file.<br />
rebuildinterchangecfg &#8211; Used after moving a domain with Interchange to the server.<br />
rebuildnamedconf &#8211; Restore named.conf from files in /var/named.<br />
rebuildproftpd &#8211; Restore proftpd.conf from httpd.conf.<br />
reinstallmailman &#8211; Reinstalls mailman.<br />
relocatevartousr &#8211; Relocates files from /var to /usr in case of disk space issues.<br />
remdefssl &#8211; Remove default SSL vhost.<br />
reseteximtodefaults &#8211; Resets exim’s default settings.<br />
resetimappasswds &#8211; Resets all imap passwords.<br />
resetquotas &#8211; Change quotas to what they should be .<br />
restartsrv &#8211; Restart a service.<br />
restartsrv_apache &#8211; Restart apache.<br />
restartsrv_bind &#8211; Restart bind.<br />
restartsrv_clamd &#8211; Restart clamd.<br />
restartsrv_courier &#8211; Restart courier imap.<br />
restartsrv_cppop &#8211; Restart cppop.<br />
restartsrv_entropychat &#8211; Restart entropy chat.<br />
restartsrv_exim &#8211; Restart exim.<br />
restartsrv_eximstats &#8211; Restart exim statistics.<br />
restartsrv_ftpserver &#8211; Restart your ftp server.<br />
restartsrv_httpd &#8211; Restart httpd.<br />
restartsrv_imap &#8211; Restart impad.<br />
restartsrv_inetd &#8211; Restart inetd.<br />
restartsrv_interchange &#8211; Restart Interchange Shopping Cart.<br />
restartsrv_melange &#8211; Restart melange chat.<br />
restartsrv_mysql &#8211; Restart mysqld.<br />
restartsrv_named &#8211; Restart named.<br />
restartsrv_postgres &#8211; Restart postgresql.<br />
restartsrv_postgresql &#8211; Restart postgresql.<br />
restartsrv_proftpd &#8211; Restart proftpd.<br />
restartsrv_pureftpd &#8211; Restart pure-ftpd.<br />
restartsrv_spamd &#8211; Restart spamd.<br />
restartsrv_sshd &#8211; Restart sshd.<br />
restartsrv_syslogd &#8211; Restart syslogd.<br />
restartsrv_tomcat &#8211; Restart tomcat.<br />
restartsrv_xinetd &#8211; Restart xinetd.<br />
restoremail &#8211; Restores a user’s mail.<br />
reswhostmgr &#8211; Restart whostmgr.<br />
rpmup &#8211; Upgrade redhat/mandrake errata/security.<br />
rrdtoolinstall &#8211; Installs RRD Tool.<br />
runstatsonce &#8211; Runs statistics (should be used from the crontab).<br />
runweblogs &#8211; Run analog/webalizer/etc. for a user.<br />
safeperlinstaller &#8211; Installs perl safely.<br />
safeup2date &#8211; Runs up2date safely.<br />
safeyum &#8211; Runs yum safely.<br />
secureit &#8211; Remove unnecessary suid binaries.<br />
securemysql &#8211; Attempts to secure the MySQL configuration.<br />
securetmp &#8211; Adds securetmp to system startup.<br />
setupfp &#8211; Install FrontPage 3 on an account.<br />
setupfp4 &#8211; Install FrontPage 4 (2000) installer on an account.<br />
setupfp5 &#8211; Install FrontPage 5 (2002) installer on an account.<br />
setupfp5.nosueuxec &#8211; Install FrontPage 5 (2002) installer on an account when not using suexec.<br />
showexelist &#8211; Shows exe processes.<br />
simpleps &#8211; Display the process list.<br />
smartcheck &#8211; Checks hard drive integrity.<br />
smtpmailgdionly &#8211; Enables SMTP Mail Protection.<br />
spamboxdisable &#8211; Disables SpamAssassin’s spambox delivery for all accounts.<br />
suspendacct &#8211; Suspends an account.<br />
sysup &#8211; update cPanel RPMs.<br />
unlimitnamed &#8211; Installs the latest version of bind patched to support greater than 512 ips on the server.<br />
unblockip &#8211; Unblocks an IP blocked by portsentry.<br />
unsetupfp4 &#8211; Removes FrontPage 4 or 5 from an account.<br />
unslavenamedconf &#8211; If the user accidentally sets a DNS master as local server, this will repair named.conf after the loop.<br />
unsuspendacct &#8211; Unsuspends an account.<br />
upcp &#8211; Updates cPanel.<br />
updated &#8211; Updates /scripts.<br />
updatefrontpage &#8211; Updates FrontPage<br />
updatenow &#8211; Updates /scripts NOW.<br />
updatephpconf &#8211; Updates PHP configuration files.<br />
whoowns &#8211; Finds out who owns a domain.<br />
wwwacct &#8211; Creates an account.<br />
xaddonreport &#8211; Reports the current addon scripts installed.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://instacarma.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://instacarma.com/blog/technical/useful-cpanel-scripts-and-their-functions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Script to auto-delete emails older than a year</title>
		<link>http://instacarma.com/blog/technical/script-to-auto-delete-emails-older-than-a-year/</link>
		<comments>http://instacarma.com/blog/technical/script-to-auto-delete-emails-older-than-a-year/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 12:36:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=535</guid>
		<description><![CDATA[Issue : Emails older than a year need to be deleted automatically. Solution : You can use &#8216;find&#8217; against the standard mail folders : find -P /home/*/mail/*/*/cur -mtime &#8216;+365&#8242; find -P /home/*/mail/*/*/new -mtime &#8216;+365&#8242; Note : 365 is the number of days in a year. You can change this number as per your requirement. This [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Issue </strong>: </p>
<p>Emails older than a year need to be deleted automatically.<br />
<strong><br />
Solution</strong> :</p>
<p>You can use &#8216;find&#8217; against the standard mail folders :</p>
<blockquote><p> find -P /home/*/mail/*/*/cur -mtime &#8216;+365&#8242;<br />
 find -P /home/*/mail/*/*/new -mtime &#8216;+365&#8242;</p></blockquote>
<p>Note : 365 is the number of days in a year. You can change this number as per your requirement.</p>
<p>This will give you a list of old mails which can be piped into a file. Then have a script parse this file.<br />
A simple example :</p>
<blockquote><p>#!/bin/bash<br />
IFS=&#8221;$&#8221;</p>
<p>cd /home</p>
<p>find -P /home/*/mail/*/*/* -mindepth 1 -maxdepth 1 -mtime &#8216;+365&#8242; | while read EMAIL; do<br />
  echo &#8220;Deleting ${EMAIL} &#8230;&#8221;<br />
  rm -f &#8220;${OLDMAIL}&#8221;<br />
done</p></blockquote>
<p>You can remove the &#8216;echo&#8217; line and add the code to a cronjob to have your server delete old emails automatically.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://instacarma.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://instacarma.com/blog/technical/script-to-auto-delete-emails-older-than-a-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script for clearing unwanted queued emails from the server</title>
		<link>http://instacarma.com/blog/technical/script-for-clearing-unwanted-queued-emails-from-the-server/</link>
		<comments>http://instacarma.com/blog/technical/script-for-clearing-unwanted-queued-emails-from-the-server/#comments</comments>
		<pubDate>Sun, 24 May 2009 16:51:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=388</guid>
		<description><![CDATA[Here is a small but handy script which will clear the queued emails from the server. exim -bpc exim -bpru &#124; grep frozen &#124; awk {&#8216;print $3&#8242;}&#124;xargs exim -Mrm exim -bpru &#124; grep &#8220;&#60;&#62;&#8221; &#124; awk {&#8216;print $3&#8242;}&#124;xargs exim -Mrm exim -bpru &#124; grep &#8220;nobody&#8221; &#124; awk {&#8216;print $3&#8242;}&#124;xargs exim -Mrm exim -bpru&#124;awk {&#8216;print $3&#8242;}&#124;xargs [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a small but handy script which will clear the queued emails from the server.</p>
<blockquote><p>exim -bpc<br />
exim -bpru | grep frozen | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru | grep &#8220;&lt;&gt;&#8221; | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru | grep &#8220;nobody&#8221; | awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exim -bpru|awk {&#8216;print $3&#8242;}|xargs exim -Mrm<br />
exiqgrep -o 86400 -i | xargs exim -Mrm<br />
exim -bpc</p></blockquote>
<p>This script will display the number of queued emails before clearing, then clear them and display the number after clearing them.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://instacarma.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://instacarma.com/blog/technical/script-for-clearing-unwanted-queued-emails-from-the-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log cleaner script</title>
		<link>http://instacarma.com/blog/technical/log-cleaner-script/</link>
		<comments>http://instacarma.com/blog/technical/log-cleaner-script/#comments</comments>
		<pubDate>Thu, 07 May 2009 15:31:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=107</guid>
		<description><![CDATA[This script will clear the apache logs, cpanel logs and the logs in /var. It will take a zipped backup before clearing logs. #!/bin/bash # Script to Clear Logs echo &#8220;Clearing Logs in /var&#8230;..&#8221; cd /var/log for i in `ls -lSh /var/log&#124;grep -v gz&#124;grep &#8220;\-rw&#8221;&#124;head -15&#124;awk {&#8216;print $9&#8242;}` do cp -p &#8220;$i&#8221; &#8220;$i&#8221;.bak echo &#8220;&#8221;&#62;$i [...]]]></description>
			<content:encoded><![CDATA[<p>This script will clear the apache logs, cpanel logs and the logs in /var. It will take a zipped backup before clearing logs.</p>
<blockquote><p>#!/bin/bash<br />
# Script to Clear Logs<br />
echo &#8220;Clearing Logs in /var&#8230;..&#8221;<br />
cd /var/log<br />
for i in `ls -lSh /var/log|grep -v gz|grep &#8220;\-rw&#8221;|head -15|awk {&#8216;print $9&#8242;}`<br />
do<br />
cp -p &#8220;$i&#8221; &#8220;$i&#8221;.bak<br />
echo &#8220;&#8221;&gt;$i<br />
if [ -e "$i".bak.gz ]<br />
then<br />
mv &#8220;$i&#8221;.bak.gz &#8220;$i&#8221;.bak1.gz<br />
fi<br />
gzip &#8220;$i&#8221;.bak<br />
done<br />
echo &#8220;Clearing Cpanel logs&#8230;..&#8221;<br />
cd /usr/local/cpanel/logs<br />
echo &#8220;access_log error_log login_log stats_log melange.log&#8221; &gt; /tmp/LOG<br />
for i in `cat /tmp/LOG|cut -f1`<br />
do<br />
cp -p &#8220;$i&#8221; &#8220;$i&#8221;.bak<br />
echo &#8220;&#8221;&gt;$i<br />
if [ -e "$i".bak.gz ]<br />
then<br />
mv &#8220;$i&#8221;.bak.gz &#8220;$i&#8221;.bak1.gz<br />
fi<br />
gzip &#8220;$i&#8221;.bak<br />
done<br />
echo &#8220;Clearing Apache logs&#8230;..&#8221;<br />
cd /usr/local/apache/logs<br />
echo &#8220;suexec_log ssl_engine_log access_log error_log&#8221; &gt; /tmp/LOG<br />
for i in `cat /tmp/LOG|cut -f1`<br />
do<br />
cp -p &#8220;$i&#8221; &#8220;$i&#8221;.bak<br />
echo &#8220;&#8221;&gt;$i<br />
if [ -e "$i".bak.gz ]<br />
then<br />
mv &#8220;$i&#8221;.bak.gz &#8220;$i&#8221;.bak1.gz<br />
fi<br />
gzip &#8220;$i&#8221;.bak<br />
done<br />
echo &#8220;/var/log /usr/local/apache/logs /usr/local/cpanel/logs&#8221; &gt; /tmp/LOG<br />
echo &#8220;Removing Old backup logs&#8221;<br />
for i in `cat /tmp/LOG|cut -f1`<br />
do<br />
cd $i<br />
rm -f *.bak1.gz<br />
done<br />
rm -f /tmp/LOG<br />
echo &#8220;Restarting Syslog&#8230;&#8221;<br />
service syslog restart<br />
echo &#8220;Thank you for using this script &#8211; InstaCarma&#8221;</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://instacarma.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://instacarma.com/blog/technical/log-cleaner-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to list all the open ports</title>
		<link>http://instacarma.com/blog/technical/script-to-list-all-the-open-ports/</link>
		<comments>http://instacarma.com/blog/technical/script-to-list-all-the-open-ports/#comments</comments>
		<pubDate>Sat, 02 May 2009 18:34:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=110</guid>
		<description><![CDATA[This could be a very good utility to check the open ports in the server. #!/bin/sh export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin if [ -e /etc/master.passwd ]; then netstat -an &#124; grep LISTEN &#124; grep &#8220;*&#8221; &#124; awk &#8216;{print $4 }&#8217; &#124; cut -d. -f2 &#124; sort -n &#124; uniq else netstat -an &#124; grep LISTEN &#124; grep -v [...]]]></description>
			<content:encoded><![CDATA[<p>This could be a very good utility to check the open ports in the server.</p>
<blockquote><p>#!/bin/sh</p>
<p>export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin</p>
<p>if [ -e /etc/master.passwd ]; then<br />
netstat -an | grep LISTEN | grep &#8220;*&#8221; | awk &#8216;{print $4 }&#8217; | cut -d. -f2 | sort -n | uniq<br />
else<br />
netstat -an | grep LISTEN | grep -v STREAM | grep : | awk &#8216;{print $4 }&#8217; | cut -d: -f2-4 | cut -d : -f3 | sort -n | uniq</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://instacarma.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://instacarma.com/blog/technical/script-to-list-all-the-open-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script for Reseller check and Adding Vhost</title>
		<link>http://instacarma.com/blog/technical/script-for-reseller-check-and-adding-vhost/</link>
		<comments>http://instacarma.com/blog/technical/script-for-reseller-check-and-adding-vhost/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 18:17:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Quick fixes]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[reseller]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://instacarma.com/blog/?p=202</guid>
		<description><![CDATA[Description: The following script will determine the shared user type I.E normal shared user, reseller or resold. In addition the script will also display the number of number of ModRails or Mongrel instances and the port used. While entering a reseller or resold account name the details of Mongrel / ModRails instances of all the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Description:</strong></p>
<p>The following script will determine the shared user type I.E normal shared user, reseller or resold. In addition the script will also display the number of number of ModRails or Mongrel instances and the port used. While entering a reseller or resold account name the details of Mongrel / ModRails instances of all the users under the reseller will be displayed. The script will be very handy  while adding Vhost entries for either a reseller or a resold account. The script will create custom.conf file under the path /usr/local/apache/conf/userdata/std/2/USER_NAME/DOMAIN_NAME/ and add necessary content to this file. Finally, it will output the exact /scripts/ensure_vhost_includes command that needs to be executed to include the custom.conf file to the apache Vhost.<br />
<strong><br />
Working:</strong></p>
<p>The script will take the account name as the input and it will check the user&#8217;s existence in the /etc/userdomains file. If the user is existing there then the user&#8217;s existence will be verified in the /var/cpanel/resellers file. If the result is positive then the Mongrel/ ModRails details of reseller account along with resold account will be displayed. If the username is not existing in the /var/cpanel/resellers file then the based on the owner of the user from the file /etc/trueuserowners the account type will be determined. Once the type of the username is determined, for a resold account the complete Mongrel / ModRails details of the other resold accounts along with reseller will be displayed. For the normal shared account the no: of mongrel (it&#8217;s port) and the ModRails will be displayed.</p>
<p>For adding vhost entry the script will take input from the following list of options.</p>
<p>Mongrel (M/m), Passenger (P/p), SVN (S/s) or Trac (T/t) ?</p>
<p><strong>Usage:</strong></p>
<p>Mongrel : We need to provide with the domain name, port on which mongrel is started and the number of instances.<br />
Mod_rails : Requires only the domain name.<br />
SVN : Requires only the domain name.<br />
TRAC : We need to specify the domain name , CGI file and the trac_env.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<blockquote><p>#!/bin/bash<br />
echo -ne &#8220;enter the account name:&#8221;<br />
read accname</p>
<p>if [ "$accname" == "" ]<br />
then<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;<br />
echo &#8221; Please enter an account name&#8221;<br />
echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;<br />
exit<br />
fi</p>
<p># Funtion to initialize parameters</p>
<p>initi () {<br />
a=0<br />
b=0<br />
o=0<br />
r=0<br />
R=0<br />
}</p>
<p>resellershow ()<br />
{<br />
initi<br />
echo &#8220;========================================&gt;&lt;==========================================&#8221;<br />
echo -e &#8221; The Reseller account &#8211;  33[1;38m $reseller  33[0m details "<br />
echo "========================================&gt;&lt;=========================================="<br />
for i in `grep -w $reseller /etc/trueuserowners | cut -f1 -d :`<br />
do<br />
if [ -d /usr/local/apache/conf/userdata/std/2/$i ] &amp;&amp; [ $reseller != $i ]<br />
then<br />
a=`grep BalancerMember /usr/local/apache/conf/userdata/std/2/$i/* -R | wc -l`<br />
b=`expr &#8220;$a&#8221; + &#8220;$b&#8221;`<br />
p=`grep BalancerMember /usr/local/apache/conf/userdata/std/2/$i/* -R | cut -f4 -d :`<br />
r=`grep RailsBaseURI /usr/local/apache/conf/userdata/std/2/$i/* -R | wc -l`<br />
R=`expr &#8220;$r&#8221; + &#8220;$R&#8221;`<br />
if [ $a -ne "0" ] || [ $r -ne "0" ]<br />
then<br />
echo &#8221; Resold : &#8216;$i&#8217; &#8211;&gt; &#8216;$r&#8217;ModRails &#8211; $a mongrel (&#8221; $p &#8220;) &#8221;<br />
fi<br />
elif [ -d /usr/local/apache/conf/userdata/std/2/$i ] &amp;&amp; [ $reseller == $i ]<br />
then<br />
a=`grep BalancerMember /usr/local/apache/conf/userdata/std/2/$i/* -R | wc -l`<br />
p=`grep BalancerMember /usr/local/apache/conf/userdata/std/2/$i/* -R | cut -f4 -d :`<br />
b=`expr &#8220;$a&#8221; + &#8220;$b&#8221;`<br />
r=`grep RailsBaseURI /usr/local/apache/conf/userdata/std/2/$i/* -R | wc -l`<br />
R=`expr &#8220;$r&#8221; + &#8220;$R&#8221;`<br />
if [ $a -ne "0" ] || [ $r -ne "0" ]<br />
then<br />
echo &#8221; Reseller : &#8216;$i&#8217; &#8211;&gt; &#8216;$r&#8217;ModRails &#8211; $a mongrel (&#8221; $p &#8220;) &#8221;<br />
fi</p>
<p>fi</p>
<p>done</p>
<p>echo &#8221; &#8221;</p>
<p>echo &#8220;Reseller has a total of &#8216;$b&#8217; mongrel instance(s) and &#8216;$R&#8217; Modrails instance(s)&#8221;</p>
<p>echo &#8221; &#8221;<br />
}<br />
cut -f2 -d : /etc/userdomains | grep -w $accname &gt; /dev/null 2&gt;&amp;1<br />
if [ $? == 0 ]<br />
then</p>
<p>grep -w $accname /var/cpanel/resellers &gt; /dev/null 2&gt;&amp;1<br />
if [ $? == 0 ]<br />
then<br />
echo &#8220;You have entered a reseller name&#8221;<br />
reseller=$accname<br />
resellershow<br />
else<br />
initi<br />
if [ -d /usr/local/apache/conf/userdata/std/2/$accname ]<br />
then<br />
a=`grep BalancerMember /usr/local/apache/conf/userdata/std/2/$accname/* -R | wc -l`<br />
b=`expr &#8220;$a&#8221; + &#8220;$b&#8221;`<br />
p=`grep BalancerMember /usr/local/apache/conf/userdata/std/2/$accname/* -R | cut -f4 -d :`<br />
r=`grep RailsBaseURI /usr/local/apache/conf/userdata/std/2/$accname/* -R | wc -l`<br />
fi</p>
<p>reseller=`grep -w $accname /etc/trueuserowners | cut -f2 -d : | head -1`<br />
if [ $reseller == "root" ]<br />
then</p>
<p>TYPE=`grep PLAN /var/cpanel/users/$accname | cut -f2 -d =`<br />
if [ $a -gt '0' ] || [ $r -gt '0' ]<br />
then</p>
<p>echo &#8221; &#8221;</p>
<p>echo -e &#8220; 33[1;38m $accname  33[0m is a $TYPE account and having '$r' Modrails - '$a' mongrel (" $p ") "<br />
echo " "<br />
else<br />
echo " "<br />
echo -e " 33[1;38m $accname  33[0m  is a $TYPE account"<br />
echo " "<br />
fi<br />
else<br />
echo "You have entered a resold account of the reseller: $reseller"<br />
resellershow<br />
fi<br />
fi<br />
else<br />
echo " "<br />
echo " Please enter a valid account name <img src='http://instacarma.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> "<br />
echo " "<br />
exit 1<br />
fi</p>
<p>echo -ne "Vhost entry type: Mongrel (M/m), Passenger (P/p), SVN (S/s), Trac (T/t) ? "</p>
<p>read proxy<br />
domaincheck () {<br />
echo -ne "Enter the domain name--&gt;"<br />
read domain<br />
grep $domain /etc/userdomains &gt; /dev/null 2&gt;&amp;1<br />
if [ $? == 0 ]<br />
then<br />
checkver=`grep $domain /etc/userdomains | cut -f2 -d : | head -1`<br />
if [ $accname == $checkver ]<br />
then<br />
mkdir -p /usr/local/apache/conf/userdata/std/2/$accname/$domain<br />
else<br />
echo &#8220;The domain name entered is not matching with the account: please cross check it from /etc/userdomains and you are exiting from script&#8221;<br />
exit 3<br />
fi<br />
else<br />
echo &#8220;Invalid domain name: Sorry you are exiting from script&#8221;<br />
exit 2<br />
fi<br />
}<br />
case $proxy in</p>
<p>M | m )</p>
<p>domaincheck<br />
echo -ne &#8220;Enter the port number:&#8221;<br />
read port<br />
echo &#8221; RewriteEngine On&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; # Rewrite index to check for static&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; RewriteRule ^/$ /index.html [QSA] &#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; # Rewrite to check for Rails cached page&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; RewriteRule ^([^.]+)$ $&#8221;1&#8243;.html [QSA]&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; # Redirect all non-static requests to cluster&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; &#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf</p>
<p>recinstcheck () {<br />
echo -ne &#8221; enter the Mongrel instances &#8211;&gt;&#8221;<br />
read instance<br />
if [ $instance -le "10" ] &amp;&amp; [ $instance -gt "0" ]<br />
then<br />
for inst in `seq 1 $instance`<br />
do<br />
echo &#8221; BalancerMember http://127.0.0.1:$port&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
port=`expr $port + 1`<br />
done<br />
else<br />
echo &#8220;Sorry Maximum allowed is 10 and minimun is 1: Invalid Input and you are exiting from script&#8221;<br />
recinstcheck<br />
fi<br />
}<br />
recinstcheck</p>
<p>echo &#8221; &#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;Now execute the command /scripts/ensure_vhost_includes &#8211;user=$accname &#8221;</p>
<p>;;</p>
<p>P | p )<br />
domaincheck<br />
echo &#8220;RailsBaseURI /&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;Now execute the command /scripts/ensure_vhost_includes &#8211;user=$accname &#8221;<br />
;;</p>
<p>T | t )<br />
domaincheck<br />
echo -ne &#8221; Enter the name of the CGI file: &#8221;<br />
read trac<br />
echo -ne &#8221; Enter the name of the trac_env: &#8221;<br />
read env<br />
echo &#8220;ScriptAlias /trac &#8220;/home/$accname/public_html/cgi-bin/&#8221;" &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; Options Indexes MultiViews&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; AllowOverride None&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; Order allow,deny&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; Allow from all&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; SetEnv TRAC_ENV &#8220;/home/$accname/$env&#8221;" &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; AuthType basic&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; AuthName trac&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; AuthUserFile &#8220;/home/$accname/authfiles/svn-htpasswd&#8221;" &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; Require valid-user&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;Now execute the command /scripts/ensure_vhost_includes &#8211;user=$accname &#8221;<br />
;;</p>
<p>S | s )<br />
domaincheck<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;DAV svn&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; SVNParentPath /home/$accname/svn&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; AuthType Basic &#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; AuthName &#8220;Enter Login Info&#8221; &#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; AuthUserFile /home/$accname/authfiles/svn-htpasswd&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; Require valid-user&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; AuthzSVNAccessFile /home/$accname/authfiles/svn-access.conf&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8221; Satisfy Any&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;&#8221; &gt;&gt; /usr/local/apache/conf/userdata/std/2/$accname/$domain/custom.conf<br />
echo &#8220;Now execute the command /scripts/ensure_vhost_includes &#8211;user=$accname &#8221;<br />
;;</p>
<p>* )</p>
<p>echo &#8220;Invalid input, you are exiting from the script&#8221;<br />
exit<br />
;;</p>
<p>esac</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://instacarma.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://instacarma.com/blog/technical/script-for-reseller-check-and-adding-vhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
