Hi,
Currently I am running a script that asks the user for the machine name after the first login. On older laptops with Mojave or earlies OS the script gets triggered and runs perfectly, however on the new laptops that come with Catalina it won’t work. This is the script used. I wonder if the issue is caused by any security policies on Catalina or because it's bash and not zsh?
!/bin/bash
/usr/bin/osascript << EOF property compName : ""
repeat while compName is ""
tell application "Finder"
activate
display dialog "What should this computer be named:" default answer compName
set compName to text returned of result
end tell
end repeat
try
do shell script "hostname " & quoted form of compName
on error errorMsg number errorNum
display alert "Error " & errorNum message errorMsg buttons "Cancel" default button 1
end try
EOF
name=$(hostname)
scutil --set ComputerName "${name}"
scutil --set LocalHostName "${name}"
scutil --set HostName "${name}"
Execute the Jamf Inventory run to set the new computername at Jamf,
otherwise jamf will use for the next command "his own" computername like macbook pro
jamf recon
Execute the policy "Bind the machine to LDAP" via Trigger ADBind
jamf policy -event ADBind
Execute the policy "Set Custom DNS Searchdomains" via Trigger set-domains
jamf policy -event set-domains
Checks if Mcafee is already installed, if not, run policy McAfee Installation
if ! [ -f "/etc/ma.d/EPOAGENT3000/config.xml" ] ; then
jamf policy -event install-mcafee
else
VERSION="Not installed."
fi
