mirror of
https://github.com/arkenfox/user.js.git
synced 2025-05-02 06:53:37 +02:00
Update the flag implementation using getopts, and create an updater flag
This commit is contained in:
parent
e4a85c30c1
commit
835c3556c9
1 changed files with 21 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## prefs.js cleaner for Linux/Mac
|
## prefs.js cleaner for Linux/Mac
|
||||||
## author: @claustromaniac
|
## author: @claustromaniac
|
||||||
## version: 1.5
|
## version: 1.6
|
||||||
|
|
||||||
## special thanks to @overdodactyl and @earthlng for a few snippets that I stol..*cough* borrowed from the updater.sh
|
## special thanks to @overdodactyl and @earthlng for a few snippets that I stol..*cough* borrowed from the updater.sh
|
||||||
|
|
||||||
|
@ -28,7 +28,8 @@ fUsage() {
|
||||||
echo -e "\nUsage: $0 [-s]"
|
echo -e "\nUsage: $0 [-s]"
|
||||||
echo -e "
|
echo -e "
|
||||||
Optional Arguments:
|
Optional Arguments:
|
||||||
-s Start immediately"
|
-s Start immediately
|
||||||
|
-u Update prefsCleaner.sh and execute silently. Do not seek confirmation."
|
||||||
}
|
}
|
||||||
|
|
||||||
fFF_check() {
|
fFF_check() {
|
||||||
|
@ -90,13 +91,29 @@ echo "This will allow inactive preferences to be reset to their default values."
|
||||||
echo -e "\nThis Firefox profile shouldn't be in use during the process.\n"
|
echo -e "\nThis Firefox profile shouldn't be in use during the process.\n"
|
||||||
echo -e "\nIn order to proceed, select a command below by entering its corresponding number.\n"
|
echo -e "\nIn order to proceed, select a command below by entering its corresponding number.\n"
|
||||||
|
|
||||||
[ "$1" == '-s' ] && fStart
|
## Flag implementation
|
||||||
|
while getopts "su" OPTION
|
||||||
|
do
|
||||||
|
case $OPTION in
|
||||||
|
s)
|
||||||
|
fStart
|
||||||
|
;;
|
||||||
|
u)
|
||||||
|
download_file
|
||||||
|
update_updater
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
select option in Start Help Exit; do
|
select option in Start Update Help Exit; do
|
||||||
case $option in
|
case $option in
|
||||||
Start)
|
Start)
|
||||||
fStart
|
fStart
|
||||||
;;
|
;;
|
||||||
|
Update)
|
||||||
|
download_file
|
||||||
|
update_updater
|
||||||
|
;;
|
||||||
Help)
|
Help)
|
||||||
fUsage
|
fUsage
|
||||||
echo -e "\nThis script creates a backup of your prefs.js file before doing anything."
|
echo -e "\nThis script creates a backup of your prefs.js file before doing anything."
|
||||||
|
|
Loading…
Add table
Reference in a new issue