Jump to content

harvey

Member
  • Posts

    22
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by harvey

  1. On 12/10/2020 at 11:49 PM, sid said:

    I needed to add semi-colons to the bash function to get this working for me

     

    
    modern1 () { osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges'; }
    modern2 () { osascript -e 'do shell script "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder" with administrator privileges'; }

     

     

    Hi, thanks for the heads up. Version 2.0.2 pushed to Packal

  2. On 12/4/2020 at 9:58 PM, Samplex said:

    @harveyAny update for Big Sur?

     

    I have released a new version. The code has been completely re-written so please let me know if there are any issues.

     

    I have also added logic to support 11.1+ so if the current command does not change, it should to continue to work without requiring an update.

     

    Please ensure you use v2.0.1 

     

    Updated link is https://www.packal.org/workflow/flush-dns-106-110

  3. 2 hours ago, Pierpaolo said:

    Added Catalina (simple as 123 thanks to @harvey! )

     

    
    #!/bin/bash
    
    ver=`sw_vers -productVersion`
    
    IFS='.' read -r -a array <<< "$ver"
    
    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]} -ge 7 -a ${array[1]} -le 9 ]; then
        echo "Version ${ver} is 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]} -ge 11 -a ${array[1]} -le 14 ]; then
        echo "Version ${ver} is El Capitan, Sierra, High Sierra or Mojave"
        osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges'
    elif [ ${array[1]} -ge 14 -a ${array[1]} -le 15 ]; then
        echo "Version ${ver} is Catalina"
        osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges'
    else
        echo "Version ${ver} is Unknown"
        exit 1
    fi

     

     

    Thanks @Pierpaolo for the reminder. I have updated the logic to support 10.15. New version is on Packal.

  4.  

    Thanks @bigorno. I have updated logic to support 10.14 Mojave. New version is on Packal. Used a slightly better method:-

     

    #!/bin/bash
    
    ver=`sw_vers -productVersion`
    
    IFS='.' read -r -a array <<< "$ver"
    
    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]} -ge 7 -a ${array[1]} -le 9 ]; then
        echo "Version ${ver} is 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]} -ge 11 -a ${array[1]} -le 14 ]; then
        echo "Version ${ver} is El Capitan, Sierra, High Sierra or Mojave"
        osascript -e 'do shell script "sudo killall -HUP mDNSResponder" with administrator privileges'
    else
        echo "Version ${ver} is Unknown"
        exit 1
    fi

     

  5. On 02/04/2018 at 3:24 AM, xilopaint said:

    The color of the icon doesn't suit well in Alfred dark themes. Please, consider to change the icon's color to suit both light and dark themes or add an option to change the icon according the theme.

     

    I'm not much of a designer. If your able to provide an icon I'm happy to consider it.

  6. A simple command to Flush DNS cache. Compatible with 10.6 through to 12.0. Takes no arguments but asks for system password to run the task as an admin user.

     

    Available on packal.org

     

    Any issues, please let me know.

     

    Update 04/08/2021: Added support for macOS Monterey 12.0. Commands remain the same based on early Betas.

    Update 12/12/2020: Bug Fix

    Update 06/12/2020: Support for macOS Big Sur 11.0 - Re-written code. Also allowed future to use the current command if it remains valid without future release 

    Update 22/12/2019: Support for macOS Catalina 10.15

    Update 20/1/2019: Support for macOS Mojave 10.14

    Update 20/4/2018: Updated icon

    Update 24/1/2018: Support for macOS High Sierra 10.13

    Update 12/1/2017: Support for macOS Sierra 10.12

     

    Screen Shot 2018-04-20 at 09.47.01.png1201939741_Screenshot2019-01-20at16_45_01.thumb.png.1f16b9cc7f0a574714923cbb780f29ef.png

     

×
×
  • Create New...