Script's in Resource Kit

Not applicable

All,

When using the following scripts from the Resource Kit:

setTimeServer.sh
enableFileSharing.sh
enableFirewall.sh
encryptVirtualMemory.sh

I receive the following errors:

/usr/sbin/jamf is version 7.01
Executing Policy ACI Compliance Preferences...
Downloading http://zaphod.it.anl.gov:80/CasperShare/Scripts//enableFileSharing.sh ...
Running Script enableFileSharing.sh...
Script Exit Code:2
Script Result: /private/tmp/enableFileSharing.sh: line 1: syntax error near unexpected token `newline'
/private/tmp/enableFileSharing.sh: line 1: `'
Downloading http://zaphod.it.anl.gov:80/CasperShare/Scripts//enableFirewall.sh ...
Running Script enableFirewall.sh...
Script Exit Code:2
Script Result: /private/tmp/enableFirewall.sh: line 1: syntax error near unexpected token `newline'
/private/tmp/enableFirewall.sh: line 1: `'
Downloading http://zaphod.it.anl.gov:80/CasperShare/Scripts//encryptVirtualMemory.sh ...
Running Script encryptVirtualMemory.sh...
Script Exit Code:2
Script Result: /private/tmp/encryptVirtualMemory.sh: line 1: syntax error near unexpected token `newline'
/private/tmp/encryptVirtualMemory.sh: line 1: `'
Downloading http://zaphod.it.anl.gov:80/CasperShare/Scripts//ACIsetTimeServer.sh ...
Running Script ACIsetTimeServer.sh...
Script Exit Code:2
Script Result: /private/tmp/ACIsetTimeServer.sh: line 1: syntax error near unexpected token `newline'
/private/tmp/ACIsetTimeServer.sh: line 1: `'

I'm running the scripts has a policy that execute at login, (tried startup as well). I tried hard coding the values into the script, and specifying the value in parameter 4 of JSS.

Any ideas why the script does not work? When hard coded, script runs fine in terminal.

Anthony Avarca
aavarca at anl.gov
630.252.4940

3 REPLIES 3

Bukira
Contributor

Did u tab from one parameter to the next when u set them

I think that's a bug in setting parameters

Not applicable

I recreated the policy, without using tab to set parameters, but the outcome is the same. Here is additional info from the system that might help bring more  clarity:

Oct  9 13:19:02 caspertest com.apple.loginwindow[5492]: Executing Policy ACI Compliance Preferences... Oct  9 13:19:02 caspertest com.apple.loginwindow[5492]: Downloading http://zaphod.it.anl.gov:80/CasperShare/Scripts//enableFileSharing.sh... Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Running Script enableFileSharing.sh... Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Script Exit Code:2 Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Script Result: /private/tmp/enableFileSharing.sh: line 1: syntax error near unexpected token `newline' Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: /private/tmp/enableFileSharing.sh: line 1: `<?xml version="1.0" encoding="ISO-8859-1"?>' Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Downloading http://zaphod.it.anl.gov:80/CasperShare/Scripts//enableFirewall.sh... Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Running Script enableFirewall.sh... Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Script Exit Code:2 Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Script Result: /private/tmp/enableFirewall.sh: line 1: syntax error near unexpected token `newline' Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: /private/tmp/enableFirewall.sh: line 1: `<?xml version="1.0" encoding="ISO-8859-1"?>' Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Downloading http://zaphod.it.anl.gov:80/CasperShare/Scripts//encryptVirtualMemory.sh... Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Running Script encryptVirtualMemory.sh... Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Script Exit Code:2 Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Script Result: /private/tmp/encryptVirtualMemory.sh: line 1: syntax error near unexpected token `newline' Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: /private/tmp/encryptVirtualMemory.sh: line 1: `<?xml version="1.0" encoding="ISO-8859-1"?>' Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Downloading http://zaphod.it.anl.gov:80/CasperShare/Scripts//ACIsetTimeServer.sh... Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Running Script ACIsetTimeServer.sh... Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Script Exit Code:2 Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: Script Result: /private/tmp/ACIsetTimeServer.sh: line 1: syntax error near unexpected token `newline' Oct  9 13:19:03 caspertest com.apple.loginwindow[5492]: /private/tmp/ACIsetTimeServer.sh: line 1: `<?xml version="1.0" encoding="ISO-8859-1"?>' Oct  9 13:19:04 caspertest com.apple.loginwindow[5492]: Submitting log to https://zaphod.it.anl.gov:8443/...

 

Not applicable

open the script file, go to the beginning of the second line.
press delete to remove the return on the first line.
then press enter again.
save, and then try the script again.

Tony S. Wu
tonyswu at mac.com