-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #244 from iAGorynT/iAGorynT-Code-Snippet-Changes
Added Homebrew Autoudpate Functionality
- Loading branch information
Showing
3 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/zsh | ||
|
||
# Trap Ctl-C and Require a Menu Selection to Exit Script | ||
trap 'echo -e "\nCtrl-C will not terminate $0."' INT | ||
|
||
function autoupdatestart { | ||
clear | ||
echo "Starting Brew Autoupdate..." | ||
echo | ||
brew autoupdate start --upgrade --greedy --cleanup --enable-notification --immediate | ||
} | ||
|
||
function autoupdatestatus { | ||
clear | ||
echo "Brew Autoupdate Status..." | ||
echo | ||
brew autoupdate status | ||
} | ||
|
||
function autoupdatestop { | ||
clear | ||
echo "Brew Autoupdate Stop..." | ||
echo | ||
brew autoupdate stop | ||
} | ||
|
||
function autoupdatedelete { | ||
clear | ||
echo "Brew Autoupdate Delete..." | ||
echo | ||
brew autoupdate delete | ||
} | ||
|
||
function autoupdatehelp { | ||
clear | ||
echo "Brew Autoupdate Help..." | ||
echo | ||
brew autoupdate --help | more | ||
} | ||
|
||
function menu { | ||
clear | ||
echo | ||
echo -e "\t\t\tBrew Autoupdate Menu\n" | ||
echo -e "\t1. Start Autoupdate" | ||
echo -e "\t2. Autoupdate Status" | ||
echo -e "\t3. Stop Autoupdate" | ||
echo -e "\t4. Delete Autoupdate" | ||
echo -e "\t5. Autoupdate Help" | ||
echo -e "\t0. Exit Menu\n\n" | ||
echo -en "\t\tEnter an Option: " | ||
read -k 1 option | ||
} | ||
|
||
while [ 1 ] | ||
do | ||
menu | ||
case $option in | ||
0) | ||
break ;; | ||
1) | ||
autoupdatestart ;; | ||
|
||
2) | ||
autoupdatestatus ;; | ||
|
||
3) | ||
autoupdatestop ;; | ||
|
||
4) | ||
autoupdatedelete ;; | ||
|
||
5) | ||
autoupdatehelp ;; | ||
|
||
*) | ||
clear | ||
echo "Sorry, wrong selection";; | ||
esac | ||
echo -en "\n\n\t\t\tHit any key to continue" | ||
read -k 1 line | ||
done | ||
clear | ||
|
||
# Reset Trap Ctl-C | ||
trap INT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters