scripts/functions.bash: update helper functions