Update script.sh

Implement functions