Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • The assignment to IPADDR assumes that there is only one active network interface besides localhost Commented Jul 29, 2014 at 14:31
  • 1
    @patrix that is correct. I've mentioned about that in my answer. To get one specific interface IP script would need to be changed. Commented Jul 29, 2014 at 14:34
  • Upps, right, didn't notice that Commented Jul 29, 2014 at 14:35
  • 1
    @AmitSchandillia You may insert this script to AppleScript editor, add line like: do shell script ... with administrator privileges You'll be prompted to input Your password. Another way is to make an application which will launch Your script with sudo. Generally executables properly enclosed inside *.app bundle does not have to launch Terminal. Commented Jul 29, 2014 at 15:45
  • 1
    So it's a bit risky to let apps do the work with elevated privilages. However I can help You compile ObjC application to launch bashscript. We may try to ask for passowrd with a prompt, or something with setuid/setgid. Here are some informations about differences: developer.apple.com/library/mac/documentation/security/… Commented Jul 29, 2014 at 16:32