Last active
April 25, 2018 02:39
-
-
Save sappharx/25836ca7b6d5daa954a113eb4bdc883f to your computer and use it in GitHub Desktop.
mac set up scripts
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
#!/usr/bin/env bash -e | |
# download disk image | |
cd ~/Downloads | |
curl -O https://download.docker.com/mac/stable/Docker.dmg | |
# attach disk image | |
hdiutil attach Docker.dmg | |
# copy app folder to Applications directory | |
cp -R /Volumes/Docker/Docker.app /Applications/Docker.app | |
# detach disk image volume | |
hdiutil detach /Volumes/Docker | |
# delete disk image | |
rm Docker.dmg | |
# move pwd back to where it was | |
cd - | |
# open app | |
open -a Docker.app |
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
#!/usr/bin/env bash -e | |
# download disk image | |
cd ~/Downloads | |
curl 'https://download.mozilla.org/?product=firefox-latest-ssl&os=osx&lang=en-US' | egrep -o 'https.*dmg' | xargs curl -o Firefox.dmg & | |
wait | |
# attach disk image | |
hdiutil attach Firefox.dmg | |
# copy app folder to Applications directory | |
cp -R /Volumes/Firefox/Firefox.app /Applications/Firefox.app | |
# detach disk image volume | |
hdiutil detach /Volumes/Firefox | |
# delete disk image | |
rm Firefox.dmg | |
# move pwd back to where it was | |
cd - | |
# would be nice to have the option to restore profile data from a backup | |
# open app (probably don't need to do this for firefox | |
open -a Firefox.app |
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
#!/usr/bin/env bash -e | |
# download disk image | |
cd ~/Downloads | |
curl -o iTerm2.zip 'https://iterm2.com/downloads/stable/latest' & | |
wait | |
# unzip package | |
unzip iTerm2.zip | |
# move app folder to Applications directory | |
mv iTerm.app /Applications | |
# delete zip file | |
rm iTerm2.zip | |
# move pwd back to where it was | |
cd - | |
# would be nice to have the option to restore profile data from a backup |
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
#!/usr/bin/env bash -e | |
# based off of https://github.com/docker/toolbox/blob/master/osx/uninstall.sh | |
# I don't know if the user HAS to be root to perform all the operations, but probably at least needs to be a sudoer | |
#if [ "${USER}" != "root" ]; then | |
# echo "$0 must be run as root!" | |
# exit 2 | |
#fi | |
echo "Removing Applications..." | |
rm -rf /Applications/Docker.app | |
echo "Removing docker binaries..." | |
ls -l /usr/local/bin | grep '/Applications/Docker.app' | awk '{ print $9 }' | xargs -I % rm -f '/usr/local/bin/%' | |
echo "All Done!" |
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
#!/usr/bin/env bash -e | |
# remove application | |
rm -rf /Applications/Firefox.app | |
# optionally, remove profile data | |
# probably want to prompt before removing | |
# would also be nice to allow backing up of profile data (and restoring in the install script) | |
# rm -rf "$HOME/Library/Application Support/Firefox" # there's also a Mozilla folder in there that may need to be deleted |
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
#!/usr/bin/env bash -e | |
# remove application | |
rm -rf /Applications/iTerm.app | |
# optionally, remove profile data | |
# probably want to prompt before removing | |
# would also be nice to allow backing up of profile data (and restoring in the install script) | |
# rm -rf "$HOME/Library/Application Support/iTerm2" # there's also a iTerm folder in there that may need to be deleted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
install script should handle failure to install docker and run uninstall script, e.g. when the CPU doesn't support virtualization instruction (i.e. when running in a VM where you didn't allow VT-x)
EDIT: I think this error would happen in the
cp -R ...
step