init.sh: work around trap limitation of some shells