-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfleet_client.sh
39 lines (32 loc) · 864 Bytes
/
fleet_client.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# Get the host operating system information
OS=$(uname -s)
# Define the input arguments
COMPANYGROUP="$1"
COMPANY="$2"
BUSINESSUNIT="$3"
LOCATION="$4"
CUSTOM1="$5"
# Define the contents of the file
file_contents="COMPANYGROUP=$COMPANYGROUP
COMPANY=$COMPANY
BUSINESSUNIT=$BUSINESSUNIT
LOCATION=$LOCATION
CUSTOM1=$CUSTOM1"
# Determine the target directory based on the host operating system
if [ "$OS" == "Darwin" ]; then
target_dir="/Library/Application Support/Servicemax"
elif [ "$OS" == "Linux" ]; then
target_dir="/opt/Servicemax"
else
echo "Unsupported operating system: $OS"
exit 1
fi
# Create the target directory if it doesn't exist
if [ ! -d "$target_dir" ]; then
mkdir -p "$target_dir"
fi
# Define the path to the file
file_path="$target_dir/fleet_client.env"
# Write the contents to a file
echo "$file_contents" > "$file_path"