output help if no parameters sent

This commit is contained in:
Stefen Auris 2022-08-24 21:37:27 -04:00
parent fabb4c54b7
commit 8f9fe993f5

View file

@ -1,4 +1,12 @@
#!/bin/bash #!/bin/bash
help() {
echo "Usage: $(basename $0)
[-e] Installs Firefox ESR
[-f] Installs Flatpak Firefox
[-r] Installs regular Firefox and Pins It's Priority
[-p] Purges the Snapd daemon from the system. Use if you don't want snaps anymore period."
exit 1
}
add_ppa() { add_ppa() {
sudo add-apt-repository ppa:mozillateam/ppa sudo add-apt-repository ppa:mozillateam/ppa
sudo apt update sudo apt update
@ -7,6 +15,8 @@ add_ppa() {
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
} }
if [ -z "$*" ]; then help; fi
#process flags #process flags
while getopts 'efrp:h' opt; do while getopts 'efrp:h' opt; do
case "$opt" in case "$opt" in
@ -40,13 +50,8 @@ Pin-Priority: 1001
sudo apt autoremove snapd sudo apt autoremove snapd
;; ;;
?|h) *)
echo "Usage: $(basename $0) help
[-e] Installs Firefox ESR
[-f] Installs Flatpak Firefox
[-r] Installs regular Firefox and Pins It's Priority
[-p] Purges the Snapd daemon from the system. Use if you don't want snaps anymore period."
exit 1
;; ;;
esac esac
done done