File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ elif [ ! -d "$1" ]; then
1515 exit 2
1616fi
1717
18- INSTALL_DIRECTORY=$( cd -P /var/mycodo-root/.. && pwd -P )
18+ INSTALL_DIRECTORY=" /opt "
1919echo ' 1' > " ${INSTALL_DIRECTORY} " /Mycodo/.restore
2020
2121function error_found {
@@ -27,16 +27,17 @@ function error_found {
2727 exit 1
2828}
2929
30+ cd /
31+
3032CURRENT_VERSION=$( " ${INSTALL_DIRECTORY} " /Mycodo/env/bin/python " ${INSTALL_DIRECTORY} " /Mycodo/mycodo/utils/github_release_info.py -c 2>&1 )
3133NOW=$( date +" %Y-%m-%d_%H-%M-%S" )
3234BACKUP_DIR=" /var/Mycodo-backups/Mycodo-backup-${NOW} -${CURRENT_VERSION} "
3335
3436printf " \n#### Restore of backup %s initiated %s ####\n" " $1 " " $NOW "
3537
36- printf " #### Stopping Daemon and HTTP server ####\n"
38+ printf " #### Stopping backend and frontend ####\n"
3739service mycodo stop
38- sleep 2
39- apachectl stop
40+ service mycodoflask stop
4041
4142/bin/bash " ${INSTALL_DIRECTORY} " /Mycodo/mycodo/scripts/upgrade_commands.sh initialize
4243
@@ -85,6 +86,8 @@ if ! "${INSTALL_DIRECTORY}"/Mycodo/mycodo/scripts/upgrade_commands.sh update-per
8586 error_found
8687fi
8788
89+ service mycodoflask restart
90+
8891printf " \n\nRunning post-restore script...\n"
8992if ! " ${INSTALL_DIRECTORY} " /Mycodo/mycodo/scripts/upgrade_post.sh ; then
9093 printf " Failed: Error while running post-restore script.\n"
You can’t perform that action at this time.
0 commit comments