Benign linux Download

patch.sh

Shell command-substitution syntaxShell has multiple dynamic command targets
SHA-2561835064c862147c5f4b4be80c0545e132131b357a9cadf4f3ab7b4013a72fec0

Evidence

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