2025-08-01 14:56:30 +05:00
|
|
|
#!/bin/bash
|
|
|
|
|
## Script to clear caches after static file changes. Useful for development and testing.
|
|
|
|
|
## All credit belongs to Usman Nasir
|
|
|
|
|
## To use make it executable
|
|
|
|
|
## chmod +x /usr/local/CyberCP/upgrade.sh
|
|
|
|
|
## Then run it like below.
|
|
|
|
|
## /usr/local/CyberCP/upgrade.sh
|
|
|
|
|
|
2025-08-03 23:26:55 +05:00
|
|
|
# Check if virtual environment exists
|
|
|
|
|
if [[ ! -f /usr/local/CyberCP/bin/python ]]; then
|
|
|
|
|
echo "Error: CyberPanel virtual environment not found at /usr/local/CyberCP/bin/python"
|
|
|
|
|
echo "Please ensure CyberPanel is properly installed."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2025-08-01 14:56:30 +05:00
|
|
|
cd /usr/local/CyberCP && /usr/local/CyberCP/bin/python manage.py collectstatic --no-input
|
|
|
|
|
rm -rf /usr/local/CyberCP/public/static/*
|
|
|
|
|
cp -R /usr/local/CyberCP/static/* /usr/local/CyberCP/public/static/
|
2025-08-11 15:49:31 +05:00
|
|
|
# CSF support removed - discontinued on August 31, 2025
|
|
|
|
|
# mkdir /usr/local/CyberCP/public/static/csf/
|
2025-08-01 14:56:30 +05:00
|
|
|
find /usr/local/CyberCP -type d -exec chmod 0755 {} \;
|
|
|
|
|
find /usr/local/CyberCP -type f -exec chmod 0644 {} \;
|
|
|
|
|
chmod -R 755 /usr/local/CyberCP/bin
|
|
|
|
|
chown -R root:root /usr/local/CyberCP
|
|
|
|
|
chown -R lscpd:lscpd /usr/local/CyberCP/public/phpmyadmin/tmp
|
|
|
|
|
systemctl restart lscpd
|