#!/bin/bash restoreAppRunHook() { local app_name="$1" local phase="$2" local hook="$containers_dir$app_name/restore.${phase}.hook.sh" [[ ! -f "$hook" ]] && return 0 isNotice "Running ${phase}-restore hook for $app_name" sudo -u "$docker_install_user" bash "$hook" local rc=$? if [[ $rc -eq 0 ]]; then isSuccessful "${phase}-restore hook for $app_name OK" else isError "${phase}-restore hook for $app_name failed (rc=$rc)" fi return $rc }