DEPNotify-Starter icon indicating copy to clipboard operation
DEPNotify-Starter copied to clipboard

Starter failing on OSX 12.3 fyi

Open xtian08 opened this issue 2 years ago • 1 comments

Describe the bug

Python 2.7 is now removed on OSX 12.3 and replaced with python3 but xcode is required to install which is a heavy 5.43GB before it can run the script

To Reproduce Run script 2.0.5 on OSX 12.3

Expected behavior

Script result: /Library/Application Support/JAMF/tmp/DepNotify03TEST: line 542: /usr/bin/python: No such file or directory usage: sudo -h | -K | -k | -V usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] usage: sudo [-AbEHknPS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] [VAR=value] [-i|-s] [] usage: sudo -e [-AknS] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T timeout] [-u user] file ...

Screenshots Screen Shot 2022-03-22 at 12 12 04 PM

xtian08 avatar Mar 22 '22 08:03 xtian08

Hi @xtian08 I was able to fix this by replacing code line 525 in Script version 2.0.6

#CURRENT_USER=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')

Line 525 Commented out with # to fix python code which no longer works on macOS Monterey 12.3

Added line in Script: CURRENT_USER=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

Just checked the latest version 2.0.7 here and there is no python included anymore: #After the Apple Setup completed. Now safe to grab the current user and user ID CURRENT_USER=$(/usr/bin/stat -f "%Su" /dev/console) CURRENT_USER_ID=$(id -u $CURRENT_USER) echo "$(date "+%a %h %d %H:%M:%S"): Current user set to $CURRENT_USER (id: $CURRENT_USER_ID)." >> "$DEP_NOTIFY_DEBUG"

virtualpatrick avatar Mar 22 '22 15:03 virtualpatrick