Greetings,
Below is a script I have been using with success on older versions of macOS however, it stopped working on monetary.
The script pulls the current username from "ls -l /dev/console | cut -d " " -f 4" and automatically sets the ComputerName, HostName, and LocalHostName as the current username.
Any thoughts on how to get this working again on this version of MacOS? Thanks, ~ B
##### Script
#!/bin/sh
username=`ls -l /dev/console | cut -d " " -f 4`
scutil --set ComputerName "$4""$username"
scutil --set HostName "$4""$username".<domain>
scutil --set LocalHostName "$4""$username"
jamf recon
###########
Script exit code: 2 |
Script result: /Library/Application Support/JAMF/tmp/network name auto: line 8: syntax error near unexpected token `newline' /Library/Application Support/JAMF/tmp/network name auto: line 8: `scutil --set HostName "$4""$username".<domain>' |
Error running script: return code was 2. |