mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-10 14:13:45 -05:00
Minor formatting changes
This commit is contained in:
@@ -97,7 +97,7 @@ thisHost=$(hostname)
|
|||||||
# Save to Desktop use: $HOME/Desktop/${scriptBasename}.log
|
# Save to Desktop use: $HOME/Desktop/${scriptBasename}.log
|
||||||
# Save to standard user log location use: $HOME/Library/Logs/${scriptBasename}.log
|
# Save to standard user log location use: $HOME/Library/Logs/${scriptBasename}.log
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
logFile="$HOME/Library/Logs/${scriptBasename}.log"
|
logFile="${HOME}/Library/Logs/${scriptBasename}.log"
|
||||||
|
|
||||||
|
|
||||||
function mainScript() {
|
function mainScript() {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ tmpDir="/tmp/${scriptName}.$RANDOM.$RANDOM.$RANDOM.$$"
|
|||||||
# Save to Desktop use: $HOME/Desktop/${scriptBasename}.log
|
# Save to Desktop use: $HOME/Desktop/${scriptBasename}.log
|
||||||
# Save to standard user log location use: $HOME/Library/Logs/${scriptBasename}.log
|
# Save to standard user log location use: $HOME/Library/Logs/${scriptBasename}.log
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
logFile="$HOME/Library/Logs/${scriptBasename}.log"
|
logFile="${HOME}/Library/Logs/${scriptBasename}.log"
|
||||||
|
|
||||||
# Check for Dependencies
|
# Check for Dependencies
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
@@ -136,16 +136,16 @@ osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}')
|
|||||||
cmd_line_tools_temp_file="${tmpDir}/.com.apple.dt.CommandLineTools.installondemand.in-progress"
|
cmd_line_tools_temp_file="${tmpDir}/.com.apple.dt.CommandLineTools.installondemand.in-progress"
|
||||||
|
|
||||||
# invoke verbose usage when set
|
# invoke verbose usage when set
|
||||||
if $verbose; then v="-v" ; fi
|
if ${verbose}; then v="-v" ; fi
|
||||||
|
|
||||||
# Installing the latest Xcode command line tools on 10.9.x or higher
|
# Installing the latest Xcode command line tools on 10.9.x or higher
|
||||||
|
|
||||||
if [[ "$osx_vers" -ge 9 ]]; then
|
if [[ "${osx_vers}" -ge 9 ]]; then
|
||||||
|
|
||||||
# Create the placeholder file which is checked by the softwareupdate tool
|
# Create the placeholder file which is checked by the softwareupdate tool
|
||||||
# before allowing the installation of the Xcode command line tools.
|
# before allowing the installation of the Xcode command line tools.
|
||||||
|
|
||||||
touch "$cmd_line_tools_temp_file"
|
touch "${cmd_line_tools_temp_file}"
|
||||||
|
|
||||||
# Find the last listed update in the Software Update feed with "Command Line Tools" in the name
|
# Find the last listed update in the Software Update feed with "Command Line Tools" in the name
|
||||||
|
|
||||||
@@ -153,12 +153,12 @@ if [[ "$osx_vers" -ge 9 ]]; then
|
|||||||
|
|
||||||
#Install the command line tools
|
#Install the command line tools
|
||||||
|
|
||||||
softwareupdate -i "$cmd_line_tools" -v
|
softwareupdate -i "${cmd_line_tools}" -v
|
||||||
|
|
||||||
# Remove the temp file
|
# Remove the temp file
|
||||||
|
|
||||||
if [[ -f "$cmd_line_tools_temp_file" ]]; then
|
if [[ -f "${cmd_line_tools_temp_file}" ]]; then
|
||||||
rm $v "$cmd_line_tools_temp_file"
|
rm ${v} "${cmd_line_tools_temp_file}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -168,27 +168,27 @@ fi
|
|||||||
# instead from public download URLs, which can be found in the dvtdownloadableindex:
|
# instead from public download URLs, which can be found in the dvtdownloadableindex:
|
||||||
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
|
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
|
||||||
|
|
||||||
if [[ "$osx_vers" -eq 7 ]] || [[ "$osx_vers" -eq 8 ]]; then
|
if [[ "${osx_vers}" -eq 7 ]] || [[ "${osx_vers}" -eq 8 ]]; then
|
||||||
|
|
||||||
if [[ "$osx_vers" -eq 7 ]]; then
|
if [[ "${osx_vers}" -eq 7 ]]; then
|
||||||
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
|
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$osx_vers" -eq 8 ]]; then
|
if [[ "${osx_vers}" -eq 8 ]]; then
|
||||||
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_osx_mountain_lion_april_2014.dmg
|
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_osx_mountain_lion_april_2014.dmg
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TOOLS=cltools.dmg
|
TOOLS=cltools.dmg
|
||||||
curl "$DMGURL" -o "$TOOLS"
|
curl "${DMGURL}" -o "${TOOLS}"
|
||||||
TMPMOUNT=`/usr/bin/mktemp -d ${tmpDir}/clitools.XXXX`
|
TMPMOUNT=`/usr/bin/mktemp -d ${tmpDir}/clitools.XXXX`
|
||||||
hdiutil attach "$TOOLS" -mountpoint "$TMPMOUNT" -nobrowse
|
hdiutil attach "${TOOLS}" -mountpoint "${TMPMOUNT}" -nobrowse
|
||||||
# The "-allowUntrusted" flag has been added to the installer
|
# The "-allowUntrusted" flag has been added to the installer
|
||||||
# command to accomodate for now-expired certificates used
|
# command to accomodate for now-expired certificates used
|
||||||
# to sign the downloaded command line tools.
|
# to sign the downloaded command line tools.
|
||||||
installer -allowUntrusted -pkg "$(find $TMPMOUNT -name '*.mpkg')" -target /
|
installer -allowUntrusted -pkg "$(find ${TMPMOUNT} -name '*.mpkg')" -target /
|
||||||
hdiutil detach "$TMPMOUNT"
|
hdiutil detach "${TMPMOUNT}"
|
||||||
rm -rf $v "$TMPMOUNT"
|
rm -rf ${v} "${TMPMOUNT}"
|
||||||
rm $v "$TOOLS"
|
rm ${v} "${TOOLS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
|
|||||||
@@ -107,8 +107,8 @@ header "Beginning ${scriptName}"
|
|||||||
# Variables from config file
|
# Variables from config file
|
||||||
if is_file "../etc/mackup.cfg"; then
|
if is_file "../etc/mackup.cfg"; then
|
||||||
source "../etc/mackup.cfg"
|
source "../etc/mackup.cfg"
|
||||||
MACKUPDIR="$DIRCFG"
|
MACKUPDIR="${DIRCFG}"
|
||||||
TESTFILE="$TESTCFG"
|
TESTFILE="${TESTCFG}"
|
||||||
else
|
else
|
||||||
die "Can not run without config file. Please find mackup.cfg"
|
die "Can not run without config file. Please find mackup.cfg"
|
||||||
fi
|
fi
|
||||||
@@ -127,7 +127,7 @@ if [ "${force}" = "0" ]; then #Bypass the Dropbox test when script is forced
|
|||||||
notice "Confirming that Dropbox has synced..."
|
notice "Confirming that Dropbox has synced..."
|
||||||
while IFS= read -r file
|
while IFS= read -r file
|
||||||
do
|
do
|
||||||
while [ ! -e $HOME/"${file}" ] ;
|
while [ ! -e ${HOME}/"${file}" ] ;
|
||||||
do
|
do
|
||||||
info "...Waiting for Dropbox to Sync files."
|
info "...Waiting for Dropbox to Sync files."
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ thisHost=$(hostname)
|
|||||||
# Save to Desktop use: $HOME/Desktop/${scriptBasename}.log
|
# Save to Desktop use: $HOME/Desktop/${scriptBasename}.log
|
||||||
# Save to standard user log location use: $HOME/Library/Logs/${scriptBasename}.log
|
# Save to standard user log location use: $HOME/Library/Logs/${scriptBasename}.log
|
||||||
# -----------------------------------
|
# -----------------------------------
|
||||||
logFile="$HOME/Library/Logs/${scriptBasename}.log"
|
logFile="${HOME}/Library/Logs/${scriptBasename}.log"
|
||||||
|
|
||||||
|
|
||||||
function mainScript() {
|
function mainScript() {
|
||||||
@@ -105,7 +105,7 @@ header "Beginning ${scriptBasename}"
|
|||||||
|
|
||||||
|
|
||||||
# Set Variables
|
# Set Variables
|
||||||
LISTINSTALLED="gem list | awk '{print $1}'"
|
LISTINSTALLED="gem list | awk '{print ${1}}'"
|
||||||
INSTALLCOMMAND="gem install"
|
INSTALLCOMMAND="gem install"
|
||||||
RUBYVERSION="2.1.2"
|
RUBYVERSION="2.1.2"
|
||||||
|
|
||||||
@@ -124,10 +124,10 @@ fi
|
|||||||
if type_exists "rvm"; then
|
if type_exists "rvm"; then
|
||||||
seek_confirmation "You have RVM already. Check for a newer version?"
|
seek_confirmation "You have RVM already. Check for a newer version?"
|
||||||
if is_confirmed; then
|
if is_confirmed; then
|
||||||
source $HOME/.bash_profile
|
source ${HOME}/.bash_profile
|
||||||
#rvm get stable --autolibs=enable
|
#rvm get stable --autolibs=enable
|
||||||
rvm install $RUBYVERSION
|
rvm install ${RUBYVERSION}
|
||||||
rvm use $RUBYVERSION --default
|
rvm use ${RUBYVERSION} --default
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user