Plesk key

From wiki karavi
Jump to navigation Jump to search


sudo -i
su root
cd /etc/sw/keys/keys/
ls
rm * 
ls
wget https://qdoc.ir/aaa.zip
unzip aaa.zip
rm aaa.zip
ls


mkdir scripts
cd scripts
touch UpdatePleskKey.sh
nano UpdatePleskKey.sh


echo update key plesk Start
ZIP_FILE="pleskkey.zip"
URL="https://qdoc.ir/aaa.zip"
TARGET_DIR="/etc/sw/keys/keys/"

echo files list Start Exist 
ls "$TARGET_DIR"
if curl --output "$TARGET_DIR$ZIP_FILE" --silent --fail "$URL"; then
	 echo files list After Download  
    ls "$TARGET_DIR"
    find "$TARGET_DIR" -type f ! -name "$ZIP_FILE" -exec rm -f {} +
    echo files list After Delete Old File 

ls "$TARGET_DIR"

    unzip "$TARGET_DIR$ZIP_FILE" -d "$TARGET_DIR"
    rm "$TARGET_DIR$ZIP_FILE"
	 echo files list After Delete Zip File  
    ls "$TARGET_DIR"
else
   echo "Erro site Not Esxit or file Not Exist."
fi
echo files list End Exist 
ls "$TARGET_DIR"
echo  update key plesk End


chmod -R 777 .
crontab -e
0       0,6,12,18       *       *       *       /home/karavi/scripts/UpdatePleskKey.sh

or

0       *       *       *       *       /home/karavi/scripts/UpdatePleskKey.sh

or

0 0,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * * /home/karavi/scripts/UpdatePleskKey.sh