#!/bin/bash . /usr/src/m2/framework/bash_functions.sh k_config_details cd "/home/$SYSTEM_GUI_DIR" || { report "Cannot cd to /home/$SYSTEM_GUI_DIR !" 1; report "GUI update failed" 6; exit 1;} if [ "$1" == "LATEST" ]; then report "Updating GUI to LATEST revision" 3 if ! svn update; then report "svn update /home/$SYSTEM_GUI_DIR did not completed correctly." 1 report " svn update /home/$SYSTEM_GUI_DIR" fix report " fix reported errors and run update.sh again" fix report "update.sh failed due to svn update errors" 1 k_exit 1 fi else stable_rev=$(cat /usr/src/m2/gui/stable_revision) report "Updating GUI to STABLE revision: $stable_rev" 3 if ! svn -r "$stable_rev" update; then report "svn -r $stable_rev update /home/$SYSTEM_GUI_DIR did not completed correctly." 1 report " svn -r $stable_rev update /home/$SYSTEM_GUI_DIR" fix report " fix reported errors and run update.sh again" fix report "update.sh failed due to svn update errors" 1 k_exit 1 fi fi if [ ! -f "/home/$SYSTEM_GUI_DIR/public/invoice_templates/default.xlsx" ]; then cp -f /usr/src/m2/gui/gui_config_files/default.xlsx "/home/$SYSTEM_GUI_DIR/public/invoice_templates/" report "Default template default.xlsx copied to /home/$SYSTEM_GUI_DIR/public/invoice_templates/ directory" 0 else report "Default template default.xlsx already exists in /home/$SYSTEM_GUI_DIR/public/invoice_templates/ directory" 0 fi chmod 1777 -R "/home/$SYSTEM_GUI_DIR/public/invoice_templates" chmod 777 -R "/home/$SYSTEM_GUI_DIR/public/rate_notification_templates" chmod 777 -R /tmp/m2 report "Updating Bundles" 3 source "/etc/profile.d/rvm.sh" bundle config build.nokogiri --use-system-libraries bundle update report "Bundles updated" 0 /sbin/service httpd restart # uid fix if [[ $ROCKY9 != 1 ]]; then /usr/src/m2/gui/apache_uid_fix.sh &> /dev/null fi report "GUI Updated" 0