Created
February 22, 2017 01:04
-
-
Save ryanmoon/79c2c245ff625a4c64564ff4edb0ccba to your computer and use it in GitHub Desktop.
Fix for Xsan Automounting Issues
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
#!/bin/bash | |
#################### | |
# Automount Fixer | |
#################### | |
# Install outset | |
# Place this script with an .sh in /usr/local/outset/boot-every | |
# Automount problems solved-ish | |
# Ryan Moon | |
# Diskutil value should be set to your ideal value from the output of diskutil list | wc -l | |
# San_name should be set to the name of your SAN | |
# Profit | |
main() { | |
diskutil_value="" | |
san_name="" | |
osx_vers=$(sw_vers -productVersion | awk -F "." '{print $2}') | |
if [[ "$osx_vers" -ge 11 ]]; then | |
echo "Starting Now at $(date)" >> /var/log/outset.log | |
while [[ $(diskutil list | wc -l ) -lt "$diskutil_value" ]]; do | |
echo "Waiting for SAN volumes to appear, at $(date)" >> /var/log/outset.log | |
sleep 30 | |
done | |
echo "SAN is ready to mount at $(date)" >> /var/log/outset.log | |
/usr/sbin/xsanctl mount "$san_name" | |
while [[ $(mount | awk '$3 == "/Volumes/$san_name" {print $3}') = "$diskutil_value" ]]; do | |
/usr/sbin/xsanctl mount "$san_name" | |
done | |
fi | |
exit | |
} | |
# Script | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment