mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-09 13:43:46 -05:00
minor updates
This commit is contained in:
@@ -77,10 +77,10 @@ fi
|
||||
brew upgrade mackup >/dev/null 2>&1
|
||||
|
||||
e_arrow "Checking for Mackup config files..."
|
||||
if [ ! -L ""$HOME"/.mackup" ]; then
|
||||
if is_not_symlink ""$HOME"/.mackup"; then
|
||||
ln -s "$MACKUPDIR"/.mackup "$HOME"/.mackup
|
||||
fi
|
||||
if [ ! -L ""$HOME"/.mackup.cfg" ]; then
|
||||
if is_not_symlink ""$HOME"/.mackup.cfg"; then
|
||||
ln -s "$MACKUPDIR"/.mackup.cfg "$HOME"/.mackup.cfg
|
||||
fi
|
||||
e_success "Mackup config files linked."
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# ##################################################
|
||||
|
||||
# Source global utilities
|
||||
if [ -f "../lib/utils.sh" ]; then
|
||||
source "../lib/utils.sh"
|
||||
else
|
||||
@@ -19,7 +20,7 @@ fi
|
||||
|
||||
seek_confirmation "Do you want to run the Dropbox script to install it first?"
|
||||
if is_confirmed; then
|
||||
if [ -e ./dropbox.sh ]; then
|
||||
if is_file "./dropbox.sh"; then
|
||||
./dropbox.sh
|
||||
else
|
||||
e_error "Can't find dropbox.sh"
|
||||
@@ -39,14 +40,13 @@ FILES="
|
||||
./mackup.sh
|
||||
./osx.sh
|
||||
./ssh.sh
|
||||
./ssd.sh
|
||||
"
|
||||
|
||||
seek_confirmation "Do you want to run all the scripts at once?"
|
||||
if is_confirmed; then
|
||||
for file in $FILES
|
||||
do
|
||||
if [ -e "$file" ]; then
|
||||
if is_file "$file"; then
|
||||
$file
|
||||
else
|
||||
e_error "$file does not exist. Exiting"
|
||||
@@ -58,7 +58,7 @@ for file in $FILES
|
||||
do
|
||||
seek_confirmation "Do you want to run $file?"
|
||||
if is_confirmed; then
|
||||
if [ -e "$file" ]; then
|
||||
if is_file "$file"; then
|
||||
$file
|
||||
else
|
||||
e_error "$file does not exist."
|
||||
|
||||
@@ -32,7 +32,6 @@ fi
|
||||
seek_confirmation "Run General UI Tweaks?"
|
||||
if is_confirmed; then
|
||||
|
||||
|
||||
e_success "Disabled Sound Effects on Boot"
|
||||
sudo nvram SystemAudioVolume=" "
|
||||
|
||||
@@ -685,6 +684,24 @@ if is_confirmed; then
|
||||
fi
|
||||
|
||||
|
||||
###############################################################################
|
||||
# 14. SSD-specific tweaks #
|
||||
###############################################################################
|
||||
e_header "Running SSD Specific OSX Tweaks"
|
||||
|
||||
seek_confirmation "Confirm that you have an SSD Hard Drive and want to "
|
||||
if is_confirmed; then
|
||||
|
||||
# e_success "Remove the sleep image file to save disk space"
|
||||
# sudo rm /Private/var/vm/sleepimage
|
||||
# e_success "Create a zero-byte file instead…"
|
||||
# sudo touch /Private/var/vm/sleepimage
|
||||
# e_success "…and make sure it can’t be rewritten"
|
||||
# sudo chflags uchg /Private/var/vm/sleepimage
|
||||
|
||||
e_success "Disable the sudden motion sensor as it’s not useful for SSDs"
|
||||
sudo pmset -a sms 0
|
||||
fi
|
||||
|
||||
########################## DONE #############################
|
||||
|
||||
|
||||
@@ -14,22 +14,24 @@ RUBYVERSION="2.1.2"
|
||||
|
||||
|
||||
# Check for RVM
|
||||
if [[ ! "$(type -P rvm)" ]]; then
|
||||
if type_not_exists "rvm"; then
|
||||
seek_confirmation_head "Install RVM?"
|
||||
if is_confirmed; then
|
||||
e_warning "Installing RVM (Ruby Version Manager) and Ruby which becomes the default ..."
|
||||
curl -L https://get.rvm.io | bash -s stable
|
||||
source ~/.rvm/scripts/rvm
|
||||
source "~/.rvm/scripts/rvm"
|
||||
fi
|
||||
fi
|
||||
|
||||
#Install Ruby
|
||||
if [[ "$(type -P rvm)" ]]; then
|
||||
#e_warning "Checking for newer Ruby Version"
|
||||
source $HOME/.bash_profile
|
||||
#rvm get stable --autolibs=enable
|
||||
rvm install $RUBYVERSION
|
||||
rvm use $RUBYVERSION --default
|
||||
if type_exists "rvm"; then
|
||||
seek_confirmation "You have RVM already. Check for a newer version?"
|
||||
if is_confirmed; then
|
||||
source $HOME/.bash_profile
|
||||
#rvm get stable --autolibs=enable
|
||||
rvm install $RUBYVERSION
|
||||
rvm use $RUBYVERSION --default
|
||||
fi
|
||||
fi
|
||||
|
||||
RECIPES=(
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Inspired by ~/.osx — http://mths.be/osx
|
||||
|
||||
if [ -f "../lib/utils.sh" ]; then
|
||||
source "../lib/utils.sh"
|
||||
else
|
||||
echo "You must have utils.sh to run. Exiting."
|
||||
exit
|
||||
fi
|
||||
|
||||
# Update existing sudo time stamp if set, otherwise do nothing.
|
||||
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
# SSD-specific tweaks #
|
||||
###############################################################################
|
||||
e_header "Running SSD Specific OSX Tweaks"
|
||||
|
||||
seek_confirmation "Confirm that you have an SSD Hard Drive"
|
||||
if is_confirmed; then
|
||||
|
||||
e_success "Disable local Time Machine snapshots"
|
||||
sudo tmutil disablelocal
|
||||
|
||||
e_success "Disable hibernation (speeds up entering sleep mode)"
|
||||
sudo pmset -a hibernatemode 0
|
||||
|
||||
e_success "Remove the sleep image file to save disk space"
|
||||
sudo rm /Private/var/vm/sleepimage
|
||||
e_success "Create a zero-byte file instead…"
|
||||
sudo touch /Private/var/vm/sleepimage
|
||||
e_success "…and make sure it can’t be rewritten"
|
||||
sudo chflags uchg /Private/var/vm/sleepimage
|
||||
|
||||
e_success "Disable the sudden motion sensor as it’s not useful for SSDs"
|
||||
sudo pmset -a sms 0
|
||||
|
||||
e_note "DON'T FORGET TO RESTART FOR CHANGES TO TAKE EFFECT"
|
||||
e_header "Completed SSD Specific OSX Tweaks"
|
||||
fi
|
||||
Reference in New Issue
Block a user