Skip to content

Instantly share code, notes, and snippets.

@abcdev
Last active February 3, 2017 18:52
Show Gist options
  • Select an option

  • Save abcdev/c7254f711652be70a32dcbe89bdf72c6 to your computer and use it in GitHub Desktop.

Select an option

Save abcdev/c7254f711652be70a32dcbe89bdf72c6 to your computer and use it in GitHub Desktop.
Jumpstarts a macOS based system. Only works when having a brewfile in the same directory.
#!/bin/bash
echo "Lets bootstrap -> install rust, homebrew and make use of a brewfile !"
command_exists () {
type "$1" &> /dev/null ;
}
if command_exists brew; then
brew update
brew doctor
else
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)";
brew doctor
fi
brew bundle
brew cleanup
brew cask cleanup
if command_exists rustup; then
rustup self update
rustup update
else
curl -sSf https://static.rust-lang.org/rustup.sh | sh;
fi
read -p "Do you want to write RAM to disk and wipe FileVault key on sleep? Just a little slower but much more secure! [Y/n]" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo pmset -a destroyfvkeyonstandby 1 hibernatemode 25
fi
read -p "Do you want to disable the new automatic boot on power? [Y/n]" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo nvram AutoBoot=%00
fi
@abcdev
Copy link
Author

abcdev commented Sep 26, 2016

Likes being in the same directory with a brewfile like https://gist.github.com/abcdev/c1c080ab9becac0bda6e763a6f780118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment