Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bash install): fix issue with positional param usage #361

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions bash/install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ The installer is AWS SSM aware, if `FALCON_CLIENT_ID` and `FALCON_CLIENT_SECRET`
## Install Script

```terminal
Usage: falcon-linux-install.sh [-h|--help]

Installs and configures the CrowdStrike Falcon Sensor for Linux.
Version: 1.5.4

The script recognizes the following environmental variables:
This script recognizes the following environmental variables:

Authentication:
- FALCON_CLIENT_ID (default: unset)
Expand Down Expand Up @@ -123,7 +125,7 @@ Other Options
- FALCON_PROVISIONING_TOKEN (default: unset)
The provisioning token to use for installing the sensor.
If the provisioning token is unset, the script will attempt to retrieve it from
the API using your authentication credentials and CID requirements.
the API using your authentication credentials and token requirements.

- FALCON_SENSOR_UPDATE_POLICY_NAME (default: unset)
The name of the sensor update policy to use for installing the sensor.
Expand Down Expand Up @@ -168,14 +170,18 @@ Other Options
- ALLOW_LEGACY_CURL (default: false)
To use the legacy version of curl; version < 7.55.0.

- GET_ACCESS_TOKEN (default: unset)
- GET_ACCESS_TOKEN (default: false)
Prints an access token and exits.
Requires FALCON_CLIENT_ID and FALCON_CLIENT_SECRET.
Accepted values are ['true', 'false'].

- PREP_GOLDEN_IMAGE (default: false)
To prepare the sensor to be used in a golden image.
Accepted values are ['true', 'false'].

This script recognizes the following argument:
-h, --help
Print this help message and exit.
```

### Usage
Expand Down Expand Up @@ -234,6 +240,8 @@ curl -L https://raw.githubusercontent.com/crowdstrike/falcon-scripts/v1.5.4/bash
## Uninstall Script

```terminal
Usage: falcon-linux-uninstall.sh [-h|--help]

Uninstalls the CrowdStrike Falcon Sensor from Linux operating systems.
Version: 1.5.4

Expand Down Expand Up @@ -271,6 +279,10 @@ Other Options:

- FALCON_APP (default: unset)
The proxy port for the sensor to use when communicating with CrowdStrike.

This script recognizes the following argument:
-h, --help
Print this help message and exit.
```

### Usage
Expand Down
20 changes: 14 additions & 6 deletions bash/install/falcon-linux-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

print_usage() {
cat <<EOF

Usage: $0 [-h|--help]

Installs and configures the CrowdStrike Falcon Sensor for Linux.
Version: $VERSION

The script recognizes the following environmental variables:
This script recognizes the following environmental variables:

Authentication:
- FALCON_CLIENT_ID (default: unset)
Expand Down Expand Up @@ -88,17 +91,22 @@ Other Options
To prepare the sensor to be used in a golden image.
Accepted values are ['true', 'false'].

This script recognizes the following argument:
-h, --help
Print this help message and exit.

EOF
}

VERSION="1.5.4"

main() {
if [ -n "$1" ]; then
print_usage
exit 1
fi
# If -h or --help is passed, print the usage and exit
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
print_usage
exit 0
fi

main() {
if [ "$GET_ACCESS_TOKEN" = "true" ]; then
get_oauth_token
echo "$cs_falcon_oauth_token"
Expand Down
20 changes: 14 additions & 6 deletions bash/install/falcon-linux-uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

print_usage() {
cat <<EOF

Usage: $0 [-h|--help]

Uninstalls the CrowdStrike Falcon Sensor from Linux operating systems.
Version: $VERSION

The script recognizes the following environmental variables:
This script recognizes the following environmental variables:

Authentication:
- FALCON_CLIENT_ID (default: unset)
Expand Down Expand Up @@ -40,17 +43,22 @@ Other Options:
- FALCON_APP (default: unset)
The proxy port for the sensor to use when communicating with CrowdStrike.

This script recognizes the following argument:
-h, --help
Print this help message and exit.

EOF
}

VERSION="1.5.4"

main() {
if [ -n "$1" ]; then
print_usage
exit 1
fi
# If -h or --help is passed, print the usage and exit
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
print_usage
exit 0
fi

main() {
if [ "$GET_ACCESS_TOKEN" = "true" ]; then
get_oauth_token
echo "$cs_falcon_oauth_token"
Expand Down