summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--update-me.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/update-me.in b/update-me.in
index 398e485..b115ed9 100644
--- a/update-me.in
+++ b/update-me.in
@@ -11,8 +11,15 @@ then
if ! "${hasSudo}"
then
hostname
- su -c "$(readlink -f "$0")"
- exit $?
+ err=1
+ maxCount=3
+ while [ ${err} -eq 1 ] && [ ${maxCount} -gt 0 ]
+ do
+ su -c "$(readlink -f "$0") || exit 2"
+ err=$?
+ maxCount=$[${maxCount} - 1]
+ done
+ exit ${err}
fi
pre='sudo'
else