#!/bin/sh

# OsxAdminPass
# 
#
# Created by Ofer Rivlin on 18/01/05.
# 
# **********************************************************************
# * Check for administrator authentication on Mac OS X platform.
# * This AppleScript run the sudo command.
# * In case of error (wrong authentication or canceled pressed):
# * Pass to the standard output 2 string lines: 
# * "error" and the error-number                                       
# **********************************************************************
#


osascript -e 'do shell script "sudo -K"' -e 'try' -e 'do shell script "sudo -v" with administrator privileges' -e 'on error the error_message number the error_number' -e 'return "error\n" & error_number' -e 'end try';

exit 0;



