
Richard H. answered 01/24/20
Senior Linux Systems Engineer with Red Hat certification.
set -e means exit immediately if anything you're running returns a non-zero return code (meaning that something didn't run successfully).
The section if [ "$1" = install ] is simple as well. In shell scripting, you can reference parameters passed to the script with a dollar sign "$" and then the number of the param. So in the case above is saying "if the value of the first parameter passed to the script equals install, then verify if the directory /usr/share/MyApplicationName exists.
So if you were to run: "./script.sh hello there", $1 would have the value "hello" while $2 would be "there".