First time poster here so please take it easy. What I am trying to achieve is seemingly simple, in principle, but boy has this given me a headache. What I need to achieve is this: When an LDAP user logs into a system, Safari launches with a specified URL. Only Safari should be accessible. That's it. Nothing more and nothing less. Why is this so difficult or am I being stupid? ( I am prepared to be told I am being stupid). I can't find anything in a config profile that allows this. Any suggestions would be helpful.
Solved
Launch Safari with a specified URL
Best answer by Look
I created this some time ago, but it still works.
It waits for the Finder to be ready then opens the URL passed to it in a policy.
If you tell Safari it will open in Safari, if you tell Finder it will open in the default browser.
You basically set it in a login triggered policy, with the URL specified and scoped to the computers you want and the restricted to the USer LDAP group you want it to activate for.
#!/bin/bash
The_URL="$4"
(
RunCount=0
Limit=30
Current_User="NONE_NADA_ZIP"
while [[ -z "$(ps -c -u $Current_User | awk /Finder/)" ]] && [[ "$RunCount" -lt "$Limit" ]]; do
let RunCount=$RunCount+1
sleep 2
Current_User=$(stat -f%Su /dev/console)
done
if [ "$The_URL" ] && [ "$(ps -ax -u $Current_User | awk '/Finder/ && !/awk/')" ]; then
sleep 1
/usr/bin/osascript<<END
tell application "Safari"
open location "$The_URL"
end tell
END
fi
) &Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
