If your /bin/sh is strictly POSIX, source doesn't work; the standard command is ".".

The alternative fix would be to change the first line to "#!/bin/bash".