Check current version of SSP from .deb file

This commit is contained in:
Jeremy Gardais 2019-08-13 14:10:10 +02:00
parent d4fed686d0
commit b640945618
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 12 additions and 5 deletions

View File

@ -42,15 +42,22 @@ fi
# }}} # }}}
# Vars {{{ # Vars {{{
DEBUG=0 DEBUG=1
script_wd=$(dirname "${0}") script_wd=$(dirname "${0}")
ssp_install_dir="${1}"
ssp_current_version=$(cd "${ssp_install_dir}" || exit 1 ; git status | head -n1 | cut -d" " -f4 | sed 's/v//g' ; cd - > /dev/null || exit 1)
ssp_repo_url="https://github.com/ltb-project/self-service-password" ssp_repo_url="https://github.com/ltb-project/self-service-password"
ssp_new_version=$("${script_wd}"/releasetags "${ssp_repo_url}" | head -n1 | sed 's/v//g') if [ $# -eq 1 ] ## If source directory should be used
then
ssp_install_dir="${1}"
ssp_current_version=$(cd "${ssp_install_dir}" || exit 1 ; git status | head -n1 | cut -d" " -f4 ; cd - > /dev/null || exit 1)
ssp_new_version=$("${script_wd}"/releasetags "${ssp_repo_url}" | head -n1)
else ## If .deb file should be used
ssp_current_version=$(dpkg -l self-service-password | awk '/^ii.*self-service-password/ { print $3}' | sed 's/\(.*\)-.*/\1/')
ssp_new_version=$("${script_wd}"/releasetags "${ssp_repo_url}" | head -n1 | sed 's/v//g')
fi
ssp_new_version_file="/tmp/.github.self-service-password.upgrade" ssp_new_version_file="/tmp/.github.self-service-password.upgrade"
# }}} # }}}