-
Notifications
You must be signed in to change notification settings - Fork 1
/
cleanup.sh
69 lines (59 loc) · 1.7 KB
/
cleanup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
if [ "$1" = "-full" ]
then
sudo sh cleanup.sh -u
sudo sh cleanup.sh -i
sudo sh cleanup.sh -d
sudo sh cleanup.sh -f
notify-send "Reboot Completed!" "M2"
fi
rm -rf var/*
rm -rf pub/static/*
rm -rf generated/*
chmod 777 var -R
chmod 777 pub/static -R
chmod 777 pub/media -R
chmod 777 generated -R
echo "Cache folders removed... \n"
if [ "$1" = "-u" ]
then
rm -rf app/code/Mgt/Varnish/etc/module.xml
rm -rf app/code/Mgt/Varnish/registration.php
/opt/lampp/bin/php bin/magento app:config:import
/opt/lampp/bin/php bin/magento setup:upgrade
chmod 777 var -R
chmod 777 pub/static -R
chmod 777 pub/media -R
echo "Setup Upgraded... \n"
notify-send "Setup Upgraded" "Upgraded Magento Schema"
fi
if [ "$1" = "-f" ]
then
/opt/lampp/bin/php bin/magento cache:flush
echo "\nCache Flushed... \n"
notify-send "Cache Flushed" "Cleared Magento Cache"
fi
if [ "$1" = "-d" ]
then
/opt/lampp/bin/php bin/magento setup:static-content:deploy en_US en_GB --exclude-area adminhtml --exclude-theme Magento/luma --exclude-theme Magento/blank -f
notify-send "Deployed" "Deployed static-content"
fi
if [ "$1" = "-da" ]
then
/opt/lampp/bin/php bin/magento setup:static-content:deploy en_US en_GB --exclude-area frontend --exclude-theme Magento/luma --exclude-theme Magento/blank -f
notify-send "Deployed" "Deployed Admin static-content"
fi
if [ "$1" = "-df" ]
then
/opt/lampp/bin/php bin/magento setup:static-content:deploy fr_FR -f
notify-send "Deployed FR" "Deployed FR static-content"
fi
if [ "$1" = "-i" ]
then
/opt/lampp/bin/php bin/magento indexer:reindex
notify-send "Reindexed" "Re-indexed site data"
fi
chmod 777 var -R
chmod 777 pub/static -R
chmod 777 pub/media -R
chmod 777 generated -R
echo "Clean up complete! \n"