mirror of
https://github.com/openziti/zrok.git
synced 2024-11-07 08:44:14 +01:00
require a package name instead of assuming zrok-share
This commit is contained in:
parent
4c7af44734
commit
8823c3ce7c
@ -48,15 +48,18 @@ repo_gpgcheck=1"
|
||||
if [ "$EXISTINGSUM" != "$REPOSUM" ]; then
|
||||
mv -v $REPOFILE{,".$(date -Iseconds)"}
|
||||
echo "$REPOSRC" > $REPOFILE
|
||||
|
||||
fi
|
||||
else
|
||||
echo "$REPOSRC" >| $REPOFILE
|
||||
|
||||
fi
|
||||
|
||||
$PACKAGER update --assumeyes
|
||||
$PACKAGER install --assumeyes zrok-share
|
||||
zrok version
|
||||
$PACKAGER info zrok-share
|
||||
$PACKAGER install --assumeyes "$@"
|
||||
for PKG in "$@"; do
|
||||
$PACKAGER info "$PKG"
|
||||
done
|
||||
}
|
||||
|
||||
installDebian(){
|
||||
@ -107,23 +110,30 @@ installDebian(){
|
||||
if [ "$EXISTINGSUM" != "$REPOSUM" ]; then
|
||||
mv -v $REPOFILE{,".$(date -Iseconds)"}
|
||||
echo "$REPOSRC" > $REPOFILE
|
||||
|
||||
fi
|
||||
else
|
||||
echo "$REPOSRC" >| $REPOFILE
|
||||
|
||||
fi
|
||||
|
||||
apt-get update
|
||||
apt-get install --yes zrok-share
|
||||
zrok version
|
||||
apt-cache show zrok-share=$(dpkg-query -W -f='${Version}' zrok-share)
|
||||
apt-get install --yes "$@"
|
||||
for PKG in "$@"; do
|
||||
apt-cache show "$PKG=$(dpkg-query -W -f='${Version}' $PKG)"
|
||||
done
|
||||
}
|
||||
|
||||
main(){
|
||||
if ! (( $# )); then
|
||||
echo "ERROR: No arguments provided. Please provide a space-separated list of packages to install from the OpenZiti repo." >&2
|
||||
exit 1
|
||||
fi
|
||||
# Detect the system's distribution family
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
installRedHat
|
||||
installRedHat "$@"
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
installDebian
|
||||
installDebian "$@"
|
||||
else
|
||||
echo "ERROR: Unsupported Linux distribution family. The zrok-share package is availabe as a Debian or Red Hat package." >&2
|
||||
exit 1
|
||||
@ -131,4 +141,4 @@ main(){
|
||||
}
|
||||
|
||||
# ensure the script is not executed before it is fully downloaded if curl'd to bash
|
||||
main
|
||||
main "$@"
|
Loading…
Reference in New Issue
Block a user