Skip to content

Commit 8f91a0a

Browse files
committed
update lib
1 parent 9c9463a commit 8f91a0a

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

libraries/util.bash

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,10 @@ function createInitFileFromTemplate()
311311
local -r templateFolderPath="${2}"
312312
local -r initConfigDataFromTemplate=("${@:3}")
313313

314-
createFileFromTemplate "${templateFolderPath}/${serviceName}.service.systemd" "/etc/systemd/system/${serviceName}.service" "${initConfigDataFromTemplate[@]}"
314+
createFileFromTemplate \
315+
"${templateFolderPath}/${serviceName}.service.systemd" \
316+
"/etc/systemd/system/${serviceName}.service" \
317+
"${initConfigDataFromTemplate[@]}"
315318
}
316319

317320
function deleteOldLogs()
@@ -515,6 +518,20 @@ function resetLogs()
515518
done
516519
}
517520

521+
function symlinkListUsrBin()
522+
{
523+
local -r sourceFilePaths=("${@}")
524+
525+
local sourceFilePath=''
526+
527+
for sourceFilePath in "${sourceFilePaths[@]}"
528+
do
529+
chmod 755 "${sourceFilePath}"
530+
rm -f -r "/usr/bin/$(basename "${sourceFilePath}")"
531+
ln -f -s "${sourceFilePath}" "/usr/bin/$(basename "${sourceFilePath}")"
532+
done
533+
}
534+
518535
function symlinkUsrBin()
519536
{
520537
local -r sourceBinFileOrFolder="${1}"
@@ -966,7 +983,7 @@ function installPortableBinary()
966983
then
967984
if [[ "$(getFileExtension "${downloadURL}")" = 'sh' ]]
968985
then
969-
curl -L "${downloadURL}" --retry 12 --retry-delay 5 | bash -e
986+
curl -s -L "${downloadURL}" --retry 12 --retry-delay 5 | bash -e
970987
else
971988
unzipRemoteFile "${downloadURL}" "${installFolderPath}"
972989
fi
@@ -988,8 +1005,7 @@ function installPortableBinary()
9881005

9891006
for binarySubPath in "${binarySubPaths[@]}"
9901007
do
991-
chmod 755 "${installFolderPath}/${binarySubPath}"
992-
ln -f -s "${installFolderPath}/${binarySubPath}" "/usr/bin/$(basename "${binarySubPath}")"
1008+
symlinkListUsrBin "${installFolderPath}/${binarySubPath}"
9931009
done
9941010

9951011
displayVersion "$("/usr/bin/$(basename "${binarySubPaths[0]}")" "${versionOption}")"

0 commit comments

Comments
 (0)