Last active
February 7, 2024 11:25
-
-
Save jimanx2/ebff4b3a3af171166b0b96da981ee26f to your computer and use it in GitHub Desktop.
TrendMicroDeepSecurityInstallScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ACTIVATIONURL='dsm://agents.deepsecurity.trendmicro.com:443/' | |
MANAGERURL='https://app.deepsecurity.trendmicro.com:443' | |
CURLOPTIONS='--silent --tlsv1.2' | |
linuxPlatform=''; | |
isRPM=''; | |
if [[ $(/usr/bin/id -u) -ne 0 ]]; then | |
echo You are not running as the root user. Please try again with root privileges.; | |
logger -t You are not running as the root user. Please try again with root privileges.; | |
exit 1; | |
fi; | |
if ! type curl >/dev/null 2>&1; then | |
echo "Please install CURL before running this script." | |
logger -t Please install CURL before running this script | |
exit 1 | |
fi | |
CURLOUT=$(eval curl $MANAGERURL/software/deploymentscript/platform/linuxdetectscriptv1/ -o /tmp/PlatformDetection $CURLOPTIONS;) | |
err=$? | |
if [[ $err -eq 60 ]]; then | |
echo "TLS certificate validation for the agent package download has failed. Please check that your Deep Security Manager TLS certificate is signed by a trusted root certificate authority. For more information, search for \"deployment scripts\" in the Deep Security Help Center." | |
logger -t TLS certificate validation for the agent package download has failed. Please check that your Deep Security Manager TLS certificate is signed by a trusted root certificate authority. For more information, search for \"deployment scripts\" in the Deep Security Help Center. | |
exit 1; | |
fi | |
if [ -s /tmp/PlatformDetection ]; then | |
. /tmp/PlatformDetection | |
else | |
echo "Failed to download the agent installation support script." | |
logger -t Failed to download the Deep Security Agent installation support script | |
exit 1 | |
fi | |
platform_detect | |
if [[ -z "${linuxPlatform}" ]] || [[ -z "${isRPM}" ]]; then | |
echo Unsupported platform is detected | |
logger -t Unsupported platform is detected | |
exit 1 | |
fi | |
echo Downloading agent package... | |
if [[ $isRPM == 1 ]]; then package='agent.rpm' | |
else package='agent.deb' | |
fi | |
curl -H "Agent-Version-Control: on" $MANAGERURL/software/agent/${runningPlatform}${majorVersion}/${archType}/$package?tenantID=$TENANT_ID -o /tmp/$package $CURLOPTIONS | |
echo Installing agent package... | |
rc=1 | |
if [[ $isRPM == 1 && -s /tmp/agent.rpm ]]; then | |
rpm -ihv /tmp/agent.rpm | |
rc=$? | |
elif [[ -s /tmp/agent.deb ]]; then | |
dpkg -i /tmp/agent.deb | |
rc=$? | |
else | |
echo Failed to download the agent package. Please make sure the package is imported in the Deep Security Manager | |
logger -t Failed to download the agent package. Please make sure the package is imported in the Deep Security Manager | |
exit 1 | |
fi | |
if [[ ${rc} != 0 ]]; then | |
echo Failed to install the agent package | |
logger -t Failed to install the agent package | |
exit 1 | |
fi | |
echo Install the agent package successfully |
Hi, i am sorry i am not the author of this script. I posted to gist because i need to use it in one of my servers.
but by checking the script it supposed to be downloading RPM packages without regard to the OS distribution.
i hope this helps.
thanks a lot, me too supposed to not take difference between rpm for oracle
or redhat, I had a problem with some oracle linux VM that I could not
install rpm with this script but with manual download, the issue was fixed
El mié, 7 feb 2024 a las 12:08, Haziman Hashim ***@***.***>)
escribió:
… ***@***.**** commented on this gist.
------------------------------
Hi, i am sorry i am not the author of this script. I posted to gist
because i need to use it in one of my servers.
but by checking the script it supposed to be downloading RPM packages
without regard to the OS distribution.
i hope this helps.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/jimanx2/ebff4b3a3af171166b0b96da981ee26f#gistcomment-4881172>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APVWDGYKWJYED4EBQHQKOI3YSNOEBBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTANBWHEZDOMRXU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, will this script download correct rpm if the machine is oracle linux or redhat linux? it distinguish between RPM distros?