removed [[ TEST ]] && action form for if [[ TEST ]]; then action; fi for compatibility

This commit is contained in:
levasseur
2021-09-08 17:52:16 +02:00
parent bec63a5304
commit d8c1dfddd6
13 changed files with 61 additions and 42 deletions

View File

@@ -23,9 +23,10 @@ export -f stdtime
# (or any old files if runned several time on same file)
backupdist()
{
[[ $# -lt 1 ]] &&
prnt E "backupdist(): At least one argument is required." &&
if [[ $# -lt 1 ]]; then
prnt E "backupdist(): At least one argument is required."
exit 11
fi
for file in $@; do
if [[ -f ${file} ]]; then
@@ -53,14 +54,14 @@ installfile()
local filelist=""
local i=0
[[ $# -lt 2 ]] && (
if [[ $# -lt 2 ]]; then
prnt E "installfile(): At least two arguments are required."
die 11
)
[[ $(echo $@ | grep "\*\|\?") ]] && (
fi
if [[ $(echo $@ | grep "\*\|\?") ]]; then
prnt E "installfile(): Wildcards are not authorized."
die 7
)
fi
for arg in $@; do
if [[ -f $MYPATH/repo/hosts/$HOSTNAME/$arg ]]; then