-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathon-start.sh
More file actions
20 lines (14 loc) · 599 Bytes
/
Copy pathon-start.sh
File metadata and controls
20 lines (14 loc) · 599 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# OVERVIEW
# This script disables and uninstalls the SSM agent which is present by default on Notebook Instances.
# NOTE: The SSM Agent will still be enabled for the short period between the Notebook Instance initiating and the Lifecycle Configuration script executing
ssm_status=$(status amazon-ssm-agent)
# Set -e after "status" so that the script doesn't fail if the SSM agent is already stopped
set -e
if [[ "$ssm_status" =~ "running" ]];
then
echo "Stopping SSM Agent.."
stop amazon-ssm-agent
fi
echo "Uninstalling SSM Agent.."
yum erase amazon-ssm-agent --assumeyes