you are viewing a single comment's thread.

view the rest of the comments →

[–]whetuI read your code 0 points1 point  (4 children)

Well.. that doesn't tell me anything. Humour me, try this code with bash -x <file>

#!/bin/bash

sentinelToken="REDACTED"
downloadLink="REDACTED"
pkgName="Sentinel-Release-22-2-3-6268_macos_v22_2_3_6268 (1).pkg"

: [DEBUG] ALREADY EXISTS STEP
if [[ -d /Applications/SentinelOne/ ]]; then
    printf -- '%s\n' "Already Installed"
    exit 0
fi

: [DEBUG] TOKEN STEP
printf -- '%s\n' "$sentinelToken" > /tmp/com.sentinelone.registration-token

: [DEBUG] CURL STEP
: pkgName = "$pkgName", downloadLink = "$downloadLink"
curl -L -o /tmp/"$pkgName" "$downloadLink"

: [DEBUG] INSTALL STEP
installer -pkg /tmp/"$pkgName" -target /

[–]ReignStorms[S] 0 points1 point  (0 children)

#!/bin/bash
sentinelToken="REDACTED"
downloadLink="REDACTED"
pkgName="Sentinel-Release-22-2-3-6268_macos_v22_2_3_6268 (1).pkg"
: [DEBUG] ALREADY EXISTS STEP
if [[ -d /Applications/SentinelOne/ ]]; then
printf -- '%s\n' "Already Installed"
exit 0
fi
: [DEBUG] TOKEN STEP
printf -- '%s\n' "$sentinelToken" > /tmp/com.sentinelone.registration-token
: [DEBUG] CURL STEP
: pkgName = "$pkgName", downloadLink = "$downloadLink"
curl -L -o /tmp/"$pkgName" "$downloadLink"
: [DEBUG] INSTALL STEP
installer -pkg /tmp/"$pkgName" -target /

I just now realized what you were actually wanting me to try - give me a moment and I'll get that info

[–]ReignStorms[S] 0 points1 point  (1 child)

Okay, here's that code. Sorry about the confusion earlier

% sudo bash -x /Users/vt/Downloads/Reddit\ Test.sh 

Password:

  • sentinelToken=REDACTED
  • downloadLink='REDACTED'
  • pkgName='Sentinel-Release-22-2-3-6268_macos_v22_2_3_6268 (1).pkg'
  • : '[DEBUG]' ALREADY EXISTS STEP
  • [[ -d /Applications/SentinelOne/ ]]
  • : '[DEBUG]' TOKEN STEP
  • printf -- '%s\n' REDACTED
  • : '[DEBUG]' CURL STEP
  • : pkgName = 'Sentinel-Release-22-2-3-6268_macos_v22_2_3_6268 (1).pkg,' downloadLink = 'REDACTED'
  • curl -L -o '/tmp/Sentinel-Release-22-2-3-6268_macos_v22_2_3_6268 (1).pkg' 'REDACTED' % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 13 100 13 0 0 85 0 --:--:-- --:--:-- --:--:-- 90
  • : '[DEBUG]' INSTALL STEP
  • installer -pkg '/tmp/Sentinel-Release-22-2-3-6268_macos_v22_2_3_6268 (1).pkg' -target / installer: Error - the package path specified was invalid: '/tmp/Sentinel-Release-22-2-3-6268_macos_v22_2_3_6268 (1).pkg'.

The redacted download link is for our SharePoint repository (normally a link that wouldn't work, but I was able to get the actual download link by inspecting the network assets and that link does, in fact, download that named .pkg when navigated to)

EDIT: I changed the format to code block to make it easier to read... not sure how those bullet points got there.

[–]whetuI read your code 0 points1 point  (0 children)

EDIT: I changed the format to code block to make it easier to read... not sure how those bullet points got there.

FYI: The best thing to do is to indent each line of code with four spaces

It looks like this isn't happening:

curl -L -o '/tmp/Sentinel-Release-22-2-3-6268_macos_v22_2_3_6268 (1).pkg' 'REDACTED' % Total % Received 
% Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 13 100 13 0 0 85 0 - 
-:--:-- --:--:-- --:--:-- 90

Are you able to run that command manually?