Benign linux Download

dargstack

Shell command-substitution syntaxStarts indefinite network loop
SHA-2561f379af4fff187e026da50c85830056f3650ac73826c0838eb93dd9979d3d4df

Evidence

Shell stderr discard command text lines 14–27
14:7… -s globstar nullglob
15
16# Set color codes for use with echo
17LIGHT_BLUE='\e[94m'
18LIGHT_GREEN='\e[92m'
19LIGHT_RED='\e[91m'
20LIGHT_YELLOW='\e[93m'
21NC='\e[0m'
22
23if ! hash git 2>/dev/null; then
24 echo -e "${LIGHT_BLUE}git${LIGHT_YELLOW} is not available.${NC}"
25
26 if ! hash lsb_release 2>/dev/null; then
27 echo -e "${ …
Shell parameter prefix or suffix pattern removal lines 28–51
28:15… IGHT_BLUE}lsb_release${NC} is not available."
29 exit 1
30 fi
31
32 if [[ ("$(lsb_release -is)" == "Debian") || (\
33 "$(lsb_release -is)" == "Ubuntu") ]]; then
34 sudo apt-get install -y git
35 else
36 echo -e "${LIGHT_RED}Could not install ${LIGHT_BLUE}git${LIGHT_RED}" \
⋯4 lines
41fi
42
43# Get this script's directory
44THIS=$(dirname "$(readlink -f "$0")")
45
46# convert the project name to a valid DNS name
47DIRECTORY_NAME_LITERAL="${PWD##*/}"
48DIRECTORY_NAME="${DIRECTORY_NAME_LITERAL//[^A-Za-z_]/-}"
49PROJECT_OWNER="${PWD%/*}"
50PROJECT_OWNER="${PROJECT_OWNER##*/}"
51PROJEC …
HTTP URL string literal lines 51–69
51:19… RECTORY_NAME%"_stack"}"
52
53if [ -f dargstack.env ]; then
54 export "$(grep -v '^#' dargstack.env | xargs)"
55fi
56
57ADVERTISE_ADDR=""
58MODE="development"
59OFFLINE=false
60URL="$(git remote get-url origin || true)"
61VERSION=""
62
63if [ "$URL" == "" ]; then
64 URL="https://github.com/<owner>/<name>.git"
65fi
66
67function usage() {
68 echo -e "usage: ${0##*/} ${LIGHT_YELLOW}<module>${NC}" \
69 "${LIGHT_YELLOW}<options> …
Shifts shell positional arguments lines 102–121
⋯4 lines
106function docker_sudo() {
107 local MODE="$1"
108 shift
109
110 if id -nG | grep -qw "docker"; then
111 docker "$@"
112 else
113 ENV_VARS_TO_PRESERVE=("STACK_DOMAIN")
114
115 if [ "$MODE" = "production" ]; then
116 if [ -f "./src/production/stack.env" ]; then
117 IFS=' ' read -r -a ENV_VARS_TO_PRESERVE_EXTENSION <<< "$(grep -v '^#' "./src/production/stack.env" |
118 awk -F= '{print $1}' | xargs)"
119 ENV_VARS_TO_PRESERVE+=("${ENV_VARS_TO_PRESERVE_EXTENSION[@]}")
120 else
121 echo -e "Not preserving any environment variabl …
Shell command-substitution syntax lines 126–131
126:45… then
127 IFS=' ' read -r -a ENV_VARS_TO_PRESERVE_EXTENSION <<< "$(grep -v '^#' "./src/development/stack.env" |
128 awk -F= '{print $1}' | xargs)"
129 ENV_VARS_TO_PRESERVE+=("${ENV_VARS_TO_PRESERVE_EXTENSION[@]}")
130 else
131 echo -e "Not preserving any environment variabl …

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.