Benign linux Download

patch-ns.sh

Shell command-substitution syntaxShell has multiple dynamic command targets
SHA-256aa7481892a8aee62afddf1097b0e5efd5eb3bcb9435b22de78d48de806d3173c

Evidence

Assigns shell variable from positional parameter lines 1–35
1#!/bin/bash
2
3function patch {
4 kindgroup=$1;
5 name=$2;
6 namespace=$3;
7 if ${KUBECTL} --subresource=status patch --namespace "$namespace" "$kindgroup/$name" --type=merge -p '{"status":{"conditions":[]}}' ; then
8 return 0;
9 else
10 return 1;
11 fi;
12};
⋯8 lines
21 if patch "$kindgroup" "$name" "$namespace"; then
22 echo "Successfully patched $kindgroup/$name";
23 ${KUBECTL} annotate --namespace "$namespace" "$kindgroup/$name" uptest-old-id=$(${KUBECTL} get --namespace "$namespace" "$kindgroup/$name" -o=jsonpath='{.status.atProvider.id}') --overwrite;
24 break;
25 else
26 printf "Retrying... (%d/%d) for %s/%s/%s\n" "$attempt" "$max_attempts" "$kindgroup" "$name" "$namespace" >&2;
27 fi;
28 attempt=$((attempt+1));
29 sleep 5;
30done;
31if [[ $attempt -gt $max_attempts ]]; then
32 echo "Failed to patch $kindgroup/$name after $max_attempts attempts";
33 exit 1;
34fi;
35exit 0;

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.