# Update the module
( cd $PUPPET/modules/$MODULE; git pull origin master )
+
+# Verify the module
+if ! hydra $HYDRA module-verify $MODULE; then
+ echo "ERROR: Updated module doesn't match hash, please verify and update manually."
+ exit 1
+fi
+
+# Commit
( cd $PUPPET; git commit -a -m "Updating module $MODULE"; git push )
fi
cd $PUPPET
-HASH_SUBMODULE="`git submodule | grep "modules/$MODULE " | awk '{ print $1 }'`"
+HASH_SUBMODULE="`git submodule | grep "modules/$MODULE " | awk '{ print $1 }' | sed -e 's/\+//'`"
cd $HYDRA_FOLDER/modules/$MODULE
-HASH_MODULE="`git log -1 | grep "^commit" | awk '{ print $2 }'`"
+HASH_MODULE="`git log -1 | grep "^commit" | awk '{ print $2 }' | sed -e 's/\+//'`"
if [ "$HASH_MODULE" != "$HASH_SUBMODULE" ]; then
echo "Module $MODULE: hash differ!!:"