Tutorial

You need to create a new file and then add the content inside the code tag. Please replace yourdir with your forum's directory. I do not recommend running this script without NoJs. This will significantly increase the waiting time for the next visitor to your website.

Code

#!/bin/bash
echo "Clear Started!"
sleep 2
clear
cd /yourdir/assets
rm -f *.css
rm -f *.js
rm -f *.json
echo "Assets Cleared."
sleep 2
clear
cd /yourdir/storage/cache
rm -fr *
cd /yourdir/storage/less
rm -fr *
cd /yourdir/storage/views
rm -fr *
echo "Tmp Files Cleared."
sleep 2
clear
cd /yourdir
php flarum migrate
php flarum cache:clear
echo "PHP Files Reseted."
sleep 2
clear
echo "Clear Ended. Exit!"
sleep 2
clear
cat "/etc/motd"