Skip to main content
Question

Self Service Script Question

  • February 14, 2013
  • 4 replies
  • 0 views

Forum|alt.badge.img+12
  • Valued Contributor
  • 350 replies

I created a simple script to force a machine to update itself from our internal time server. It runs in seconds locally on my machine and when pushed out via ARD. I then created a policy around it and added it to Self Service. The policy does not do anything else (no recon, etc.).

When I activate it in Self Service it never finishes and the Self Service process just runs forever. Does anyone have any ideas on why it never completes when triggered from SS?

Here's the script:

---------------------
#!/bin/bash
# Force a clock update from listed time server.
ntpdate -u 172.21.1.9
exit
---------------------

Thanks,
Tom

4 replies

Forum|alt.badge.img+6
  • Contributor
  • 15 replies
  • February 14, 2013

Why not just update the /etc/ntb.conf file to have the internal time server and an external server so that the machines always stay up to date. Here is a little script to do it.

#!/bin/bash

# List servers here
NTPServer1=time.wachovia.net
NTPServer2=time.apple.com

# Sets the first server
/usr/sbin/systemsetup -setnetworktimeserver $NTPServer1

# Adds second server to ntp config file
echo "server $NTPServer2" >> /etc/ntp.conf

# change system pref to have mac update on its own
/usr/sbin/systemsetup -setusingnetworktime on

Good Luck


Forum|alt.badge.img+12
  • Author
  • Valued Contributor
  • 350 replies
  • February 15, 2013

Thanks for that Paul. I'm going to use it to resolve a different issue.

Our systems are already set to use an internal time server. That server has been having issues so I wanted to make a Self-Service script that would force an update from a different server.


Forum|alt.badge.img+18
  • Honored Contributor
  • 486 replies
  • February 15, 2013

Have you tried running it in terminal as verbose?

sudo jamf policy trigger -id <policy id> -verbose
(the policy id can be found by going to the jss and hovering over any policy "show status" the url for that will have an id) should give you more input on why its not working from self service.


Forum|alt.badge.img+12
  • Author
  • Valued Contributor
  • 350 replies
  • February 15, 2013

Excellent idea, don't know why I didn't think of that. Will try it later today.

Thanks


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings