Failsafe ws_register for .bashrc
When the filesystems are slow/down, ws_register in the .bashrc
prevents to user from logging in, which is bad.
@jitschin--tu-dresden.de proposed a solution using timeout which can be added to the .bashrc
and is failsafe
ANSRED=$'\e[41;1m'
ANSRESET=$'\e[0m'
buf="$(timeout 10 ws_register $HOME/workspaces)";
if test $? -eq 0; then
printf "${buf}";
else
printf "${ANSRED} ws_register: timeout after 10 seconds.${ANSRESET}\n";
fi;
echo ""