DDSameera

Member
Jan 3, 2012
14
0
51
cPanel Access Level
Website Owner
There are 10 cPanel accounts in my WHM panel. i write shell script and run "git pull" code in every 10 accounts using SHELL SCRIPT
. first 05 is okay. 6th one stuck , and my ip marked as a block one.

Code:
#Get Command List
#cd /customscript/permission_and_individual_commands && bash run.sh
cd "/customscript/github";
commands=$(<command_list.txt)
echo $commands

web_root="/home"
cd $web_root
for entry in "$web_root"/*
do
    entry=$(find -L "$entry" -name "*.git");
 
    if [ ! -z "$entry" ]; then
   
    #Get .git enable web folders
    web_folder_path=$(echo $entry | sed -e "s/\.git//g")
    web_folder_path=$(echo $web_folder_path | sed -e "s/\/www//g")
    web_folder_path=$(echo $web_folder_path | sed -e "s/\/lms//g")
    web_folder_path=($web_folder_path)
   
    #log to the cPanel public_html folder
    web_folder_path=$web_folder_path"public_html"
    cd $web_folder_path  
   
   
    #Run Command List for each cPanel
    echo "cPanel Path : $web_folder_path"
    git stash;
    git pull;
   git reset --hard;
   export COMPOSER_ALLOW_SUPERUSER=1;
   composer config -g repo.packagist composer https://packagist.org
   composer update


    fi
 
done
 
Last edited by a moderator:

andrew.n

Well-Known Member
Jun 9, 2020
519
138
43
EU
cPanel Access Level
Root Administrator
How do you run this? I assume through command line or do you fetch this with wget or curl? Also can you tell us more about the environment? Do you have mod_security, firewall installed? CpHulk enabled? etc..