script-template: fix argument number check

The number of arguments should be checked after shift.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>