Commit 179b76b0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix withtimeout (was incorrect workaround)

parent 28b68c58
...@@ -262,10 +262,15 @@ set_sudo() ...@@ -262,10 +262,15 @@ set_sudo()
SUDO="fatal 'Can't find sudo. Please install sudo or run epm under root.'" SUDO="fatal 'Can't find sudo. Please install sudo or run epm under root.'"
} }
# wait for n seconds (if possible) during executing command
# args: seconds command
withtimeout() withtimeout()
{ {
local TO=$(which timeout 2>/dev/null || which gtimeout 2>/dev/null) local TO=$(which timeout 2>/dev/null || which gtimeout 2>/dev/null)
[ -n "$TO" ] && $TO $@ || $@ [ -n "$TO" ] && $TO $@ && return
# drop time arg
shift
$@
} }
set_eatmydata() set_eatmydata()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment