It would probably be worth it for the script to source the common functions to get the addtrap/settrap stuff:
`. "$BINDIR/../installer/functions"`