-
Notifications
You must be signed in to change notification settings - Fork 2
/
_helpers.bash
executable file
·23 lines (19 loc) · 1.06 KB
/
_helpers.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
PATH=/usr/local/bin:$PATH # /Users/ec2-user/aws-ec2-mac-amis/cloud-connect.bash: line 17: jq: command not found
LAUNCH_LOCATION="/Library/LaunchDaemons/"; mkdir -p "${LAUNCH_LOCATION}";
AWS_INSTANCE_USER="ec2-user"
# AWS_INSTANCE_USER_PASSWD="zbun0ok=" # This will eventually go away. It's only required because dscl enables Secure Token for ec2-user after first run (first run doesn't need an old password; passwd also does this) # no need since we can't VNC anymore
RESIZE_DISK_PLIST_PATH="${LAUNCH_LOCATION}com.veertu.aws-ec2-mac-amis.resize-disk.plist"
CLOUD_CONNECT_PLIST_PATH="${LAUNCH_LOCATION}com.veertu.aws-ec2-mac-amis.cloud-connect.plist"
ARCH="$(arch)"
[[ "${ARCH}" != "arm64" ]] && ARCH="amd64"
# get agent package name
[[ ${ARCH} == "arm64" ]] && AGENT_PKG_NAME="AnkaAgentArm.pkg" || AGENT_PKG_NAME="AnkaAgent.pkg"
modify_hosts() {
[[ -z $1 ]] && echo "ARG 1 missing" && exit 1
[[ -z $1 ]] && echo "ARG 2 missing" && exit 1
SED="sudo sed -i ''"
HOSTS_LOCATION="/etc/hosts"
$SED "/$1/d" $HOSTS_LOCATION
echo "$2 $1" | sudo tee -a $HOSTS_LOCATION
}
true