Jump to content

CKIDOW

Member
  • Posts

    1
  • Joined

  • Last visited

Profile Information

  • Location
    Berlin, Germany
  • Interests
    Drupal

Recent Profile Visitors

150 profile views

CKIDOW's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Hi, I updated the script for Mac OS High Sierra and just added these lines of code: elif [ ${array[1]} -eq 13 ]; then echo "Version ${ver} is macOS High Sierra" osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges' The final script is: #!/bin/bash # ver="10.11.1" ver=`sw_vers -productVersion` IFS='.' read -r -a array <<< "$ver" # echo ${array[0]} # echo ${array[1]} # echo ${array[2]} # if [ -z ${array[2]} ];then # echo "You have not installed any sub update" # fi if [ ${array[1]} -eq 6 ]; then echo "Version ${ver} is Snow Leopard" osascript -e 'do shell script "sudo dscacheutil -flushcache" with administrator privileges' elif [ ${array[1]} -eq 7 ] || [ ${array[1]} -eq 8 ] || [ ${array[1]} -eq 9 ]; then echo "Version ${ver} is one of the following: Lion, Mountain Lion or Mavericks" osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges' elif ([ ${array[1]} -eq 10 ] && [ -z ${array[2]} ]) || ([ ${array[1]} -eq 10 ] && [ ${array[2]} -le 3 ]); then echo "Version ${ver} is Yosemite and 10.10.3 or less" osascript -e 'do shell script "sudo discoveryutil mdnsflushcache" with administrator privileges' elif [ ${array[1]} -eq 10 ] && [ ${array[2]} -ge 4 ]; then echo "Version ${ver} is Yosemite and 10.10.4 or higher" osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges' elif [ ${array[1]} -eq 11 ]; then echo "Version ${ver} is El Capitan" osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges' elif [ ${array[1]} -eq 12 ]; then echo "Version ${ver} is macOS Sierra" osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges' elif [ ${array[1]} -eq 13 ]; then echo "Version ${ver} is macOS High Sierra" osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges' else echo "Version ${ver} is Unknown" exit 1 fi
×
×
  • Create New...