mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-25 07:48:28 +00:00
Fix netinstall
This commit is contained in:
parent
b7bb6e5b48
commit
18f19b4004
@ -28,11 +28,11 @@ fi
|
|||||||
|
|
||||||
function doInstallFromCommit(){
|
function doInstallFromCommit(){
|
||||||
local commit="$1"
|
local commit="$1"
|
||||||
tmpdir="$(mktemp -d "ark-server-tools-XXXXXXXX")"
|
tmpdir="$(mktemp -t -d "ark-server-tools-XXXXXXXX")"
|
||||||
if [ -z "$tmpdir" ]; then echo "Unable to create temporary directory"; exit 1; fi
|
if [ -z "$tmpdir" ]; then echo "Unable to create temporary directory"; exit 1; fi
|
||||||
cd "$tmpdir"
|
cd "$tmpdir"
|
||||||
echo "Downloading installer"
|
echo "Downloading installer"
|
||||||
curl -L "https://github.com/${arkstGithubRepo}/archive/${commit}.tar.gz" | tar -xz
|
curl -s -L "https://github.com/${arkstGithubRepo}/archive/${commit}.tar.gz" | tar -xz
|
||||||
cd "ark-server-tools-${commit}/tools"
|
cd "ark-server-tools-${commit}/tools"
|
||||||
if [ ! -f "install.sh" ]; then echo "install.sh not found in $PWD"; exit 1; fi
|
if [ ! -f "install.sh" ]; then echo "install.sh not found in $PWD"; exit 1; fi
|
||||||
sed -i -e "s|^arkstCommit='.*'|arkstCommit='${commit}'|" \
|
sed -i -e "s|^arkstCommit='.*'|arkstCommit='${commit}'|" \
|
||||||
@ -45,9 +45,9 @@ function doInstallFromCommit(){
|
|||||||
rm -rf "$tmpdir"
|
rm -rf "$tmpdir"
|
||||||
|
|
||||||
if [ "$result" = 0 ] || [ "$result" = 2 ]; then
|
if [ "$result" = 0 ] || [ "$result" = 2 ]; then
|
||||||
"ARK Server Tools successfully installed"
|
echo "ARK Server Tools successfully installed"
|
||||||
else
|
else
|
||||||
"ARK Server Tools install failed"
|
echo "ARK Server Tools install failed"
|
||||||
fi
|
fi
|
||||||
return $result
|
return $result
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ function doInstallFromRelease(){
|
|||||||
echo "Latest release is ${tagname}"
|
echo "Latest release is ${tagname}"
|
||||||
echo "Getting commit for latest release..."
|
echo "Getting commit for latest release..."
|
||||||
local commit="$(curl -s "https://api.github.com/repos/${arkstGithubRepo}/git/refs/tags/${tagname}" | sed -n 's/^ *"sha": "\(.*\)",.*/\1/p')"
|
local commit="$(curl -s "https://api.github.com/repos/${arkstGithubRepo}/git/refs/tags/${tagname}" | sed -n 's/^ *"sha": "\(.*\)",.*/\1/p')"
|
||||||
doUpgradeToolsFromCommit "$commit"
|
doInstallFromCommit "$commit"
|
||||||
else
|
else
|
||||||
echo "Unable to get latest release"
|
echo "Unable to get latest release"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user