output help if no parameters sent
This commit is contained in:
parent
fabb4c54b7
commit
8f9fe993f5
1 changed files with 12 additions and 7 deletions
|
@ -1,4 +1,12 @@
|
|||
#!/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() {
|
||||
sudo add-apt-repository ppa:mozillateam/ppa
|
||||
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
|
||||
}
|
||||
|
||||
if [ -z "$*" ]; then help; fi
|
||||
|
||||
#process flags
|
||||
while getopts 'efrp:h' opt; do
|
||||
case "$opt" in
|
||||
|
@ -40,13 +50,8 @@ Pin-Priority: 1001
|
|||
sudo apt autoremove snapd
|
||||
;;
|
||||
|
||||
?|h)
|
||||
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
|
||||
*)
|
||||
help
|
||||
;;
|
||||
esac
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue