package-server: Refs #1937: Add sh file

Detect reg, bat and sh files at the end of the function, according to
file extension