Revert "simpler shell script"

This reverts commit 420b928c59262def605eb9f737785cee22a4256f.