Plesk key: Difference between revisions

From wiki karavi
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 13: Line 13:
ls
ls


wget https://qdoc.ir/pleskkey.zip
wget https://qdoc.ir/aaa.zip


unzip pleskkey.zip
unzip aaa.zip


rm pleskkey.zip
rm aaa.zip


ls
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

Latest revision as of 08:07, 23 June 2025


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