[ubuntu] Refactor bash functions (#9055)

This commit is contained in:
Shamil Mubarakshin
2023-12-26 12:50:52 +01:00
committed by GitHub
parent d16bc5f120
commit 503ae89818
38 changed files with 191 additions and 224 deletions

View File

@@ -5,8 +5,8 @@
################################################################################
download_with_retry() {
url=$1
download_path=$2
local url=$1
local download_path=$2
if [ -z "$download_path" ]; then
download_path="/tmp/$(basename "$url")"
@@ -45,15 +45,6 @@ download_with_retry() {
echo "$download_path"
}
## Use dpkg to figure out if a package has already been installed
## Example use:
## if ! IsPackageInstalled packageName; then
## echo "packageName is not installed!"
## fi
IsPackageInstalled() {
dpkg -S $1 &> /dev/null
}
get_toolset_value() {
local toolset_path="/imagegeneration/installers/toolset.json"
local query=$1