Posted on 08-22-2019 11:53 AM
Hi everyone,
I have been busy for quite some time to roll out Symantec Remote based with a .sh script. But I just can't get it done.
I found a handy script here, but it still doesn't work. My background I have almost no experience with Mac devices and scripting it.
But I find it interesting and I learn a lot.
https://www.jamf.com/jamf-nation/discussions/26744/installing-pkg-using-a-bash-script-with-jamf
What I want to do is deploy a Symantec package for users via remote. With the program I work I only have the option to do it via .sh.
Based on the URL above I am kicking off the script step by step to see where it keeps crashing. But I don't get any further than the script below, so I hope someone can give me support.
After kicking off this script I get the following message back.
/Volumes/Macintosh HD/Users/Shared/temp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg: line 1: syntax error near unexpected token `<'
/Volumes/Macintosh HD/Users/Shared/temp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg: line 1: `<html><body><h1>400 Bad request</h1>'
Posted on 08-22-2019 12:35 PM
Hi, @svallas
You can skip line 4 and you do not have to create a tmp folder, and then curl your file into the /tmp (default temp folder on macOS and gets cleared out on each reboot)
Line 17 is not as it should be and see the man page "man installer" for installing a pkg through command line
as example;
sudo installer -pkg "/tmp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg" -target /
Posted on 08-26-2019 04:29 AM
Hi txhaflaire,
Sorry for the late reply, I was free for a few days.
Thank you for your response and your help.
I have already tried out the command you put here.
But I will edit the script again and add the result.
Posted on 08-26-2019 08:21 AM
Hi,
I get stuck again...
But dont I need to create a folder first where the package should go to?
Because otherwise it goes to the download folder by default, and than I cannot use your command anymore and I know it is an example.
But im trying im trying..
#!/bin/bashDownload Sepc
curl -LO "https://www.skyvalley.nl/wp-content/uploads/2019/08/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg"Run Symantec Endpoint Protection Cloud Installer
sudo installer -pkg "tmp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg" -target / sleep 10
installer: Error - the package path specified was invalid: 'tmp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg'.
Posted on 08-26-2019 09:00 AM
Try this:
#!/bin/bash
#Download Sepc
curl -L "https://www.skyvalley.nl/wp-content/uploads/2019/08/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg" -o /tmp/SEPC.pkg
#Run Symantec Endpoint Protection Cloud Installer
installer -pkg "/tmp/SEPC.pkg" -target /
sleep 10
Posted on 08-28-2019 07:39 AM
Hi and thanks for your help.
I used your script and did not change it, and this is the result that I get back
installer: Error - the package path specified was invalid: 'tmp/SEPC.pkg'.
Posted on 08-28-2019 07:49 AM
@svallas , you are missing a / in front of tmp.
Posted on 08-28-2019 09:18 PM
Thanks for you quick answer, but unfortunately I get the same error message back.
installer: Error - the package path specified was invalid: '/tmp/SEPC.pkg'.
#!/bin/bash
#Download Sepc
curl -L "https://www.skyvalley.nl/wp-content/uploads/2019/08/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg" -o /tmp/SEPC.pkg
#Run Symantec Endpoint Protection Cloud Installer
sudo installer -pkg "/tmp/SEPC.pkg" -target /
sleep 10
Posted on 08-29-2019 04:09 AM
looks to be an issue with your installer package...
Posted on 08-29-2019 04:16 AM
Actually it is the spaces in the name.
#!/bin/bash
#Download Sepc
curl -L https://www.skyvalley.nl/wp-content/uploads/2019/08/Symantec%20Endpoint%20Protection%20Cloud.UniversalESD_RI.pkg -o /tmp/SEPC.pkg
#Run Symantec Endpoint Protection Cloud Installer
installer -pkg "/tmp/SEPC.pkg" -target /
sleep 10
Give that a try. It should work now.
Posted on 08-29-2019 04:43 AM
Hi,
Wow, thanks for your sharpness.
I immediately tried out the script and we are a lot further, this is the outcome:
/Library/Application Support/com.atera.ateraagent/Packages/AgentPackageSystemTools/AgentPackageSystemToolsApp.app/Contents/MonoBundle/sepc2.sh: line 2:
: command not found
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 105M 0 8590 0 0 25005 0 1:13:36 --:--:-- 1:13:36 24970
0 105M 0 894k 0 0 668k 0 0:02:41 0:00:01 0:02:40 668k
1 105M 1 1873k 0 0 765k 0 0:02:20 0:00:02 0:02:18 765k
2 105M 2 2754k 0 0 821k 0 0:02:11 0:00:03 0:02:08 821k
3 105M 3 3874k 0 0 880k 0 0:02:02 0:00:04 0:01:58 880k
4 105M 4 4783k 0 0 893k 0 0:02:00 0:00:05 0:01:55 953k
5 105M 5 5736k 0 0 890k 0 0:02:01 0:00:06 0:01:55 948k
5 105M 5 6408k 0 0 870k 0 0:02:03 0:00:07 0:01:56 922k
6 105M 6 7326k 0 0 877k 0 0:02:02 0:00:08 0:01:54 914k
6 105M 6 7536k 0 0 775k 0 0:02:19 0:00:09 0:02:10 688k
6 105M 6 7536k 0 0 702k 0 0:02:33 0:00:10 0:02:23 511k
6 105M 6 7536k 0 0 652k 0 0:02:45 0:00:11 0:02:34 351k
7 105M 7 8322k 0 0 674k 0 0:02:39 0:00:12 0:02:27 384k
8 105M 8 9614k 0 0 719k 0 0:02:29 0:00:13 0:02:16 456k
9 105M 9 10.4M 0 0 740k 0 0:02:25 0:00:14 0:02:11 668k
11 105M 11 11.5M 0 0 773k 0 0:02:19 0:00:15 0:02:04 936k
11 105M 11 12.5M 0 0 783k 0 0:02:17 0:00:16 0:02:01 1099k
13 105M 13 13.7M 0 0 804k 0 0:02:14 0:00:17 0:01:57 1118k
14 105M 14 14.7M 0 0 823k 0 0:02:10 0:00:18 0:01:52 1104k
14 105M 14 15.6M 0 0 824k 0 0:02:10 0:00:19 0:01:51 1064k
15 105M 15 16.4M 0 0 827k 0 0:02:10 0:00:20 0:01:50 996k
16 105M 16 17.2M 0 0 824k 0 0:02:10 0:00:21 0:01:49 956k
17 105M 17 18.2M 0 0 835k 0 0:02:09 0:00:22 0:01:47 946k
18 105M 18 19.1M 0 0 837k 0 0:02:08 0:00:23 0:01:45 889k
18 105M 18 19.9M 0 0 840k 0 0:02:08 0:00:24 0:01:44 905k
19 105M 19 20.8M 0 0 842k 0 0:02:07 0:00:25 0:01:42 901k
20 105M 20 21.8M 0 0 844k 0 0:02:07 0:00:26 0:01:41 933k
21 105M 21 22.6M 0 0 849k 0 0:02:06 0:00:27 0:01:39 910k
22 105M 22 23.4M 0 0 846k 0 0:02:07 0:00:28 0:01:39 885k
23 105M 23 24.3M 0 0 850k 0 0:02:06 0:00:29 0:01:37 898k
24 105M 24 25.3M 0 0 853k 0 0:02:06 0:00:30 0:01:36 909k
24 105M 24 26.2M 0 0 853k 0 0:02:06 0:00:31 0:01:35 896k
25 105M 25 27.0M 0 0 854k 0 0:02:06 0:00:32 0:01:34 883k
26 105M 26 28.1M 0 0 861k 0 0:02:05 0:00:33 0:01:32 945k
27 105M 27 28.9M 0 0 862k 0 0:02:05 0:00:34 0:01:31 933k
28 105M 28 29.8M 0 0 863k 0 0:02:04 0:00:35 0:01:29 925k
28 105M 28 30.1M 0 0 838k 0 0:02:08 0:00:36 0:01:32 751k
28 105M 28 30.1M 0 0 813k 0 0:02:12 0:00:37 0:01:35 573k
28 105M 28 30.1M 0 0 790k 0 0:02:16 0:00:39 0:01:37 367k
28 105M 28 30.1M 0 0 763k 0 0:02:21 0:00:40 0:01:41 199k
28 105M 28 30.2M 0 0 739k 0 0:02:25 0:00:41 0:01:44 62088
28 105M 28 30.2M 0 0 732k 0 0:02:27 0:00:42 0:01:45 29023
29 105M 29 30.7M 0 0 724k 0 0:02:28 0:00:43 0:01:45 113k
29 105M 29 31.4M 0 0 727k 0 0:02:28 0:00:44 0:01:44 262k
30 105M 30 32.0M 0 0 724k 0 0:02:28 0:00:45 0:01:43 404k
31 105M 31 32.6M 0 0 722k 0 0:02:29 0:00:46 0:01:43 559k
32 105M 32 33.9M 0 0 733k 0 0:02:27 0:00:47 0:01:40 742k
33 105M 33 35.0M 0 0 741k 0 0:02:25 0:00:48 0:01:37 890k
34 105M 34 36.3M 0 0 753k 0 0:02:23 0:00:49 0:01:34 987k
35 105M 35 37.4M 0 0 760k 0 0:02:21 0:00:50 0:01:31 1086k
36 105M 36 38.7M 0 0 772k 0 0:02:19 0:00:51 0:01:28 1237k
38 105M 38 40.1M 0 0 784k 0 0:02:17 0:00:52 0:01:25 1270k
39 105M 39 41.2M 0 0 792k 0 0:02:16 0:00:53 0:01:23 1297k
40 105M 40 42.6M 0 0 803k 0 0:02:14 0:00:54 0:01:20 1298k
41 105M 41 44.1M 0 0 815k 0 0:02:12 0:00:55 0:01:17 1368k
42 105M 42 45.1M 0 0 819k 0 0:02:11 0:00:56 0:01:15 1289k
43 105M 43 45.9M 0 0 820k 0 0:02:11 0:00:57 0:01:14 1200k
45 105M 45 47.3M 0 0 831k 0 0:02:09 0:00:58 0:01:11 1245k
46 105M 46 49.0M 0 0 846k 0 0:02:07 0:00:59 0:01:08 1303k
47 105M 47 50.4M 0 0 856k 0 0:02:05 0:01:00 0:01:05 1315k
49 105M 49 51.8M 0 0 865k 0 0:02:04 0:01:01 0:01:03 1400k
50 105M 50 53.3M 0 0 874k 0 0:02:03 0:01:02 0:01:01 1485k
52 105M 52 54.8M 0 0 885k 0 0:02:01 0:01:03 0:00:58 1498k
53 105M 53 55.9M 0 0 890k 0 0:02:01 0:01:04 0:00:57 1428k
54 105M 54 57.4M 0 0 898k 0 0:01:59 0:01:05 0:00:54 1401k
56 105M 56 59.0M 0 0 910k 0 0:01:58 0:01:06 0:00:52 1465k
57 105M 57 60.6M 0 0 921k 0 0:01:57 0:01:07 0:00:50 1513k
58 105M 58 61.6M 0 0 923k 0 0:01:56 0:01:08 0:00:48 1418k
59 105M 59 62.6M 0 0 924k 0 0:01:56 0:01:09 0:00:47 1356k
60 105M 60 63.8M 0 0 929k 0 0:01:56 0:01:10 0:00:46 1329k
61 105M 61 64.8M 0 0 930k 0 0:01:55 0:01:11 0:00:44 1197k
62 105M 62 66.2M 0 0 937k 0 0:01:55 0:01:12 0:00:43 1142k
64 105M 64 67.7M 0 0 946k 0 0:01:53 0:01:13 0:00:40 1259k
65 105M 65 69.3M 0 0 954k 0 0:01:52 0:01:14 0:00:38 1375k
67 105M 67 70.7M 0 0 961k 0 0:01:52 0:01:15 0:00:37 1417k
68 105M 68 72.1M 0 0 966k 0 0:01:51 0:01:16 0:00:35 1473k
68 105M 68 72.3M 0 0 951k 0 0:01:53 0:01:17 0:00:36 1146k
68 105M 68 72.3M 0 0 937k 0 0:01:55 0:01:18 0:00:37 829k
68 105M 68 72.3M 0 0 925k 0 0:01:56 0:01:20 0:00:36 541k
68 105M 68 72.3M 0 0 912k 0 0:01:58 0:01:21 0:00:37 271k
68 105M 68 72.3M 0 0 904k 0 0:01:59 0:01:21 0:00:38 29824
68 105M 68 72.4M 0 0 890k 0 0:02:01 0:01:23 0:00:38 25910
68 105M 68 72.6M 0 0 882k 0 0:02:02 0:01:24 0:00:38 67236
69 105M 69 73.4M 0 0 880k 0 0:02:02 0:01:25 0:00:37 213k
70 105M 70 74.5M 0 0 883k 0 0:02:02 0:01:26 0:00:36 434k
71 105M 71 75.8M 0 0 888k 0 0:02:01 0:01:27 0:00:34 645k
73 105M 73 77.1M 0 0 894k 0 0:02:00 0:01:28 0:00:32 960k
74 105M 74 78.3M 0 0 898k 0 0:02:00 0:01:29 0:00:31 1170k
75 105M 75 79.7M 0 0 903k 0 0:01:59 0:01:30 0:00:29 1296k
76 105M 76 80.9M 0 0 907k 0 0:01:58 0:01:31 0:00:27 1308k
78 105M 78 82.4M 0 0 913k 0 0:01:58 0:01:32 0:00:26 1343k
79 105M 79 83.7M 0 0 919k 0 0:01:57 0:01:33 0:00:24 1363k
80 105M 80 85.2M 0 0 924k 0 0:01:56 0:01:34 0:00:22 1403k
82 105M 82 86.3M 0 0 927k 0 0:01:56 0:01:35 0:00:21 1359k
83 105M 83 87.9M 0 0 934k 0 0:01:55 0:01:36 0:00:19 1428k
84 105M 84 89.4M 0 0 940k 0 0:01:54 0:01:37 0:00:17 1452k
85 105M 85 90.4M 0 0 942k 0 0:01:54 0:01:38 0:00:16 1372k
87 105M 87 91.9M 0 0 947k 0 0:01:53 0:01:39 0:00:14 1361k
88 105M 88 93.4M 0 0 952k 0 0:01:53 0:01:40 0:00:13 1419k
90 105M 90 94.9M 0 0 959k 0 0:01:52 0:01:41 0:00:11 1441k
91 105M 91 96.2M 0 0 962k 0 0:01:52 0:01:42 0:00:10 1392k
92 105M 92 97.4M 0 0 965k 0 0:01:51 0:01:43 0:00:08 1421k
93 105M 93 98.7M 0 0 964k 0 0:01:51 0:01:44 0:00:07 1284k
94 105M 94 99.5M 0 0 967k 0 0:01:51 0:01:45 0:00:06 1274k
95 105M 95 101M 0 0 973k 0 0:01:50 0:01:46 0:00:04 1259k
96 105M 96 102M 0 0 972k 0 0:01:50 0:01:47 0:00:03 1173k
97 105M 97 103M 0 0 974k 0 0:01:50 0:01:48 0:00:02 1150k
99 105M 99 104M 0 0 976k 0 0:01:50 0:01:49 0:00:01 1257k
100 105M 100 105M 0 0 980k 0 0:01:49 0:01:49 --:--:-- 1272k
/Library/Application Support/com.atera.ateraagent/Packages/AgentPackageSystemTools/AgentPackageSystemToolsApp.app/Contents/MonoBundle/sepc2.sh: line 5:
: command not found
installer: Error - the package path specified was invalid: '/tmp/SEPC.pkg'.
/Library/Application Support/com.atera.ateraagent/Packages/AgentPackageSystemTools/AgentPackageSystemToolsApp.app/Contents/MonoBundle/sepc2.sh: line 8:
: command not found
I'm going to create a new package and see what it does.
To be continued.
Posted on 08-29-2019 04:56 AM
It looks like you are running this from a tool like Textmate or some other editor. If you save the file and then open terminal and run sudo sh /path/to/file.sh it should run without issue.
Posted on 08-29-2019 05:24 AM
I run the script via Atera our management tool, they have processed a script tool in which I can push scripts to computers remotely. So I'm testing how to get Symantec pushed to the computers through this tool.
Your script above has helped me a lot and bring me on the right path.
At a certain point I removed everything from my very first script, and executed everything line by line to see where exactly things went wrong. Now that I am troubleshooting with you, I find that I have forgotten to add a file, which is probably also the cause where your last script goes wrong.
This is a JavaScript file that comes with the package, I am just trying to process this in a script, and let you know later what the outcome has been. This will be tested later in the evening.
Posted on 08-29-2019 11:25 PM
I have tried the script with an ZIP file, this did not work, now I have tried the following, and it also does not want to work.
#!/bin/bash
#Download SEPC JavaScript
curl -L "https://www.skyvalley.nl/wp-content/uploads/2019/08/fsdmanifest.js" -o /tmp/fsdmanifest.js
#Download SEPC
curl -L https://www.skyvalley.nl/wp-content/uploads/2019/08/Symantec%20Endpoint%20Protection%20Cloud.UniversalESD_RI.pkg -o /tmp/SEPC.pkg
#Run Symantec Endpoint Protection Cloud Installer
sudo installer -pkg "/tmp/SEPC.pkg" -target /
sleep 10
I also tested locally, I think my command does not work completely. But I don't want it locally, it really has to go through Atera, are there still ideas?
Posted on 08-30-2019 05:09 AM
Using the script you have in your latest post, I saved it to my local machine as test.sh and ran it locally. I stopped the installer from fully running as to not install your license on my test machine.
Posted on 09-08-2019 10:38 PM
Hi Dennis,
which script did you use, because when I test it on the local machine I just get an error?
Below you can see the output message that I received when we tried to install this from terminal:
MacTestDevices-MacBook-Air:~ mactestdevice$ curl -L "https://www.skyvalley.nl/wp-content/uploads/2019/08/fsdmanifest.js" -o /tmp/fsdmanifest.js
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1652 100 1652 0 0 2554 0 --:--:-- --:--:-- --:--:-- 2553
MacTestDevices-MacBook-Air:~ mactestdevice$ curl -L https://www.skyvalley.nl/wp-content/uploads/2019/08/Symantec%20Endpoint%20Protection%20Cloud.UniversalESD_RI.pkg -o /tmp/SEPC.pkg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 105M 100 105M 0 0 4636k 0 0:00:23 0:00:23 --:--:-- 6922k
MacTestDevices-MacBook-Air:~ mactestdevice$ sudo installer -pkg "/tmp/SEPC.pkg" -target /
Password:
Sorry, try again.
Password:
installer: Package name is SEPC
installer: Installing at base path /
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
MacTestDevices-MacBook-Air:~ mactestdevice$
So it seems that this script doesn't work on our test Mac device, meaning that it is expected to fail when runs through Atera.
Posted on 09-09-2019 12:27 PM
@svallas Is this the steps you are taking to create the install package?
https://support.symantec.com/us/en/article.HOWTO128513.html#v127509198
Posted on 09-11-2019 12:22 AM
True, these are the steps you go through.
You indeed start by downloading the Download Package Creator "SEPC Redistributable Installer Package Tool". After you have done this, he creates 2 files that I put in my URL, the PKG file and the JS file, and put these files in the script.
Posted on 09-11-2019 05:23 AM
@svallas Use the script below. It looks like the JS manifest file was looking for a particular file name.
#!/bin/bash
#Download SEPC JavaScript
curl -L "https://www.skyvalley.nl/wp-content/uploads/2019/08/fsdmanifest.js" -o /tmp/fsdmanifest.js
#Download SEPC
curl -L https://www.skyvalley.nl/wp-content/uploads/2019/08/Symantec%20Endpoint%20Protection%20Cloud.UniversalESD_RI.pkg -o "/tmp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg"
#Run Symantec Endpoint Protection Cloud Installer
installer -pkg "/tmp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg" -target /
sleep 10
reboot
Posted on 09-13-2019 12:00 AM
Hi,
Thanks for the effort, me and the support team of Atera have tested it out your last script. But still via Atera itself or local on the machine we don't get it working.
MacTestDevices-MacBook-Air:~ mactestdevice$
MacTestDevices-MacBook-Air:~ mactestdevice$ sudo installer -pkg "/tmp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg" -target /
Password:
installer: Package name is Symantec Endpoint Protection Cloud.UniversalESD_RI
installer: Installing at base path /
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
MacTestDevices-MacBook-Air:~ mactestdevice$ #!/bin/bash
MacTestDevices-MacBook-Air:~ mactestdevice$
MacTestDevices-MacBook-Air:~ mactestdevice$ #Download SEPC JavaScript
MacTestDevices-MacBook-Air:~ mactestdevice$ curl -L "https://www.skyvalley.nl/wp-content/uploads/2019/08/fsdmanifest.js" -o /tmp/fsdmanifest.js
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1652 100 1652 0 0 3104 0 --:--:-- --:--:-- --:--:-- 3099
MacTestDevices-MacBook-Air:~ mactestdevice$
MacTestDevices-MacBook-Air:~ mactestdevice$ #Download SEPC
MacTestDevices-MacBook-Air:~ mactestdevice$ curl -L https://www.skyvalley.nl/wp-content/uploads/2019/08/Symantec%20Endpoint%20Protection%20Cloud.UniversalESD_RI.pkg -o "/tmp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 105M 100 105M 0 0 1579k 0 0:01:08 0:01:08 --:--:-- 1833k
MacTestDevices-MacBook-Air:~ mactestdevice$
MacTestDevices-MacBook-Air:~ mactestdevice$ sudo installer -pkg "/tmp/Symantec Endpoint Protection Cloud.UniversalESD_RI.pkg" -target /
Password:
installer: Package name is Symantec Endpoint Protection Cloud.UniversalESD_RI
installer: Installing at base path /
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
Posted on 09-13-2019 01:20 AM
Do you have an existing Symantec Endpoint client installed like an older, non-cloud based client on your test Mac? I've found and others as well, sorry can't cite a specific thread about it yet, that the previous client has to be uninstalled first before installing the current cloud client.
Posted on 09-13-2019 01:27 AM
Hi thanks for your message, but there are no other installations of Symantec when I start the setup.
So also no older or other versions.
Posted on 09-13-2019 03:52 AM
I ran the script on a test machine and the last script i provided ran without issue. I would recommend reaching out to Symantec and see if they are able to provide any assistance at this point.
Posted on 09-13-2019 04:01 AM
Allright thank you, Dennis’s MacBook Pro is that you?
Posted on 09-13-2019 04:05 AM
Yes that would have been my machine. I uninstalled and wiped the machine after successful installation.
Posted on 09-13-2019 04:17 AM
Allrighty, thanks again for your help and your time!
Posted on 09-13-2019 04:33 AM
Dennis could you please share the output, and execute again if necessary?
Posted on 09-13-2019 04:55 AM
Here is a screenshot of the script and me calling it in Terminal.
Posted on 09-13-2019 05:32 AM
Thank you.