put cmd in file because of needed quotes ''
This commit is contained in:
parent
a5d5169992
commit
0e194aaa09
@ -5,13 +5,14 @@ function g_retrycmd {
|
||||
[ -z "$g_tries_delay" ] && g_tries_delay=5
|
||||
# If retrys not set default to 5 times
|
||||
[ -z "$g_tries" ] && g_tries=5
|
||||
|
||||
|
||||
local g_try=0
|
||||
until [ $g_try -eq $g_tries ]
|
||||
do
|
||||
((g_try=g_try+1))
|
||||
echo "$(g_date_print) Try $g_try of $g_tries"
|
||||
$@ && break
|
||||
echo "$@" >$g_tmp/g_retrycmd.cmd
|
||||
bash $g_tmp/g_retrycmd.cmd && break
|
||||
g_return=$?
|
||||
[ $g_try -eq $g_tries ] && return $g_return
|
||||
sleep $g_tries_delay
|
||||
|
Loading…
Reference in New Issue
Block a user