v-update-sys-theme 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. quiet=$1
  3. source $HESTIA/func/main.sh
  4. source $HESTIA/conf/hestia.conf
  5. welcome_message() {
  6. echo "********************************************************"
  7. echo "* Hestia Control Panel - User Interface Theme Updater *"
  8. echo "********************************************************"
  9. echo " This script will update the themes currently "
  10. echo " available on your system, which may include bug fixes "
  11. echo " and improvements from our development team which are "
  12. echo " intended to provide a user better experience "
  13. echo "********************************************************"
  14. echo " Proceed with theme update installation? "
  15. echo " [Y/n] "
  16. echo ""
  17. }
  18. if [ "$quiet" ]; then
  19. answer="y"
  20. else
  21. welcome_message
  22. read -p "" answer
  23. fi
  24. if [ "$answer" = "y" ] || [ "$answer" = "Y" ] || [ "$answer" = "yes" ]; then
  25. echo ""
  26. echo "Updating system base theme..."
  27. if [ -e "$HESTIA/web/css/styles.min.css" ]; then
  28. rm -f "$HESTIA/web/css/styles.min.css"
  29. fi
  30. wget -O $HESTIA/web/css/styles.min.css $HESTIA_GIT_REPO/$RELEASE_BRANCH/web/css/styles.min.css --show-progress --progress=bar:force --limit-rate=3m
  31. echo "Updating included themes..."
  32. for themefile in `ls $HESTIA/install/deb/themes`; do
  33. if [ -e $themefile ]; then
  34. rm -f $themefile
  35. fi
  36. echo "Downloading $themefile..."
  37. wget -O $HESTIA_INSTALL_DIR/themes/$themefile $HESTIA_GIT_REPO/$RELEASE_BRANCH/install/deb/themes/$themefile --show-progress --progress=bar:force --limit-rate=3m
  38. done
  39. if [ "$THEME" != "default" ]; then
  40. echo "Applying updated system interface theme..."
  41. $BIN/v-change-sys-theme $THEME
  42. fi
  43. else
  44. echo "Update process aborted."
  45. fi