diff options
Diffstat (limited to 'utils/morty.sh')
| -rwxr-xr-x | utils/morty.sh | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/utils/morty.sh b/utils/morty.sh index 60220df02..c04df7a0c 100755 --- a/utils/morty.sh +++ b/utils/morty.sh @@ -49,6 +49,7 @@ usage() { usage:: $(basename "$0") shell $(basename "$0") install [all|check|user] + $(basename "$0") reinstall all $(basename "$0") update [morty] $(basename "$0") remove [all] $(basename "$0") activate [service] @@ -66,6 +67,8 @@ install / remove :user: add/remove service user '$SERVICE_USER' ($SERVICE_HOME) install :check: check the morty installation +reinstall: + :all: runs 'install/remove all' update morty Update morty installation ($SERVICE_HOME) activate service @@ -145,6 +148,16 @@ main() { ;; *) usage "$_usage"; exit 42;; esac ;; + reinstall) + rst_title "re-install $SERVICE_NAME" part + sudo_or_exit + case $2 in + all) + remove_all + install_all + ;; + *) usage "$_usage"; exit 42;; + esac ;; install) rst_title "$SERVICE_NAME" part sudo_or_exit @@ -286,6 +299,7 @@ install_check() { if [[ "${GO_VERSION}" > "$(go_version)" ]]; then warn_msg "golang ($(go_version)) needs to be $GO_VERSION at least" + warn_msg "you need to reinstall $SERVICE_USER --> $0 reinstall all" else info_msg "golang $(go_version) is installed (min needed is: $GO_VERSION)" fi @@ -326,7 +340,7 @@ EOF cat > "$GO_ENV" <<EOF export GOPATH=\$HOME/go-apps -export PATH=\$PATH:\$HOME/local/go/bin:\$GOPATH/bin +export PATH=\$HOME/local/go/bin:\$GOPATH/bin:\$PATH EOF echo "Environment $GO_ENV has been setup." @@ -345,12 +359,7 @@ install_morty() { rst_title "Install morty in user's ~/go-apps" section echo tee_stderr <<EOF | sudo -i -u "$SERVICE_USER" 2>&1 | prefix_stdout "$_svcpr" -go get -v -u github.com/asciimoo/morty -EOF - tee_stderr <<EOF | sudo -i -u "$SERVICE_USER" 2>&1 | prefix_stdout "$_svcpr" -cd \$GOPATH/src/github.com/asciimoo/morty -go test -go test -benchmem -bench . +go install -v github.com/asciimoo/morty@latest EOF } @@ -358,12 +367,7 @@ update_morty() { rst_title "Update morty" section echo tee_stderr <<EOF | sudo -i -u "$SERVICE_USER" 2>&1 | prefix_stdout "$_svcpr" -go get -v -u github.com/asciimoo/morty -EOF - tee_stderr <<EOF | sudo -i -u "$SERVICE_USER" 2>&1 | prefix_stdout "$_svcpr" -cd \$GOPATH/src/github.com/asciimoo/morty -go test -go test -benchmem -bench . +go install -v github.com/asciimoo/morty@latest EOF } @@ -513,7 +517,7 @@ This installs a reverse proxy (ProxyPass) into nginx site (${NGINX_MORTY_SITE})" # shellcheck disable=SC2034 SEARX_SRC=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_SRC) # shellcheck disable=SC2034 - SEARX_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARX_URL_PATH) + SEARXNG_URL_PATH=$("${REPO_ROOT}/utils/searx.sh" --getenv SEARXNG_URL_PATH) nginx_install_app "${NGINX_MORTY_SITE}" info_msg "testing public url .." |