Skip to content

Instantly share code, notes, and snippets.

View cPLevey's full-sized avatar

David Levey cPLevey

  • cPanel, Inc.
  • Houston, TX
View GitHub Profile
@cPLevey
cPLevey / slowdown-upcp.hook
Created June 10, 2016 07:24
Site5 cPanel Update "Slowdown" Hook
#!/bin/bash
# Pre-upcp hook which will deny upcp in case the server already has IO,
# chef-client, cdp etc. are running..!
# Story: https://wwwhosting.atlassian.net/browse/SH-222
# Set limit load avg. for VPS/hardware
# Defaults to 6 for VPS and 10 for hardware ones
if [[ $(/sbin/lspci | wc -l) -eq 0 ]]; then
limit_load=6
@cPLevey
cPLevey / outgoing_mail_suspended_users.sh
Last active May 6, 2016 07:22
outgoing_mail_suspended_users fix
#!/bin/sh
# Quick fix script for CPANEL-5806
# Ver. 0.05
CMP_ERROR_COUNT=$(grep 'check_mail_permissions' /var/log/exim_mainlog |wc -l);
CREATED_FILE=0;
if [ "$CMP_ERROR_COUNT" -ne "0" ]; then
echo "$CMP_ERROR_COUNT errors found in the exim main log referencing a check_mail_permissions issue.";
echo "Example(s):";
echo "===========";
grep 'check_mail_permissions' /var/log/exim_mainlog |tail -n10;
@cPLevey
cPLevey / tail-cpanel-update
Created February 17, 2016 08:06
Tail Latest cPanel Update #upcp #update #cPanel
tail -f /var/cpanel/updatelogs/last
@cPLevey
cPLevey / cpanel-update-mode.sh
Created February 17, 2016 08:04
Check cPanel Update Mode #cPanel #updates #upcp
grep UPDATES /etc/cpupdate.conf