diff --git a/scripts/postgre-upgrade.sh b/scripts/postgre-upgrade.sh index 80a42e719..afb8ff8d6 100644 --- a/scripts/postgre-upgrade.sh +++ b/scripts/postgre-upgrade.sh @@ -5,7 +5,7 @@ config() if [ "$(whoami)" = "root" ] then echo "It is not recommended to run this script as root. As a normal user, elevation will be prompted if needed." - read -rp "Continue anyway? (y/n) " confirm "$FM_PATH/.awktmpfile" && mv "$FM_PATH/.awktmpfile" "$FM_PATH/docker-compose.yml" + awk "BEGIN { FS=\"\n\"; RS=\"\"; } { print gensub(/(image: postgres:$NEW(\n|.)+volumes:)/, \"\\\\1\n - ${NEW_PATH}:/var/lib/postgresql/data\", \"g\") }" "$FM_PATH/docker-compose.yml" > "$FM_PATH/.awktmpfile" && mv "$FM_PATH/.awktmpfile" "$FM_PATH/docker-compose.yml" docker-compose pull docker-compose up -d } -upgrade_elastic() +clean() +{ + read -rp "Remove the previous PostgreSQL data folder? (y/N) " confirm