Benign linux Download

bash.deb.sh

Shell command-substitution syntaxRuns an APT package install command
SHA-2568bf2dda08bb362f75f4f5486fea8f2db20d6eac34d4212467bf9c585abf05c4f

Evidence

Quoted y/yes alternatives or comparisons lines 1–38
1#!/usr/bin/env bash
2#
3# The core commands execute start from the "MAIN" section below.
4#
5
6test -z "$BASH_SOURCE" && {
7 self="sudo -E bash"
8 prefix="<curl command> |"
9} || {
10 self=$(readlink -f ${BASH_SOURCE:-$0})
11 prefix=""
12}
13
14tmp_log=$(mktemp .csm_setup_XXXXXXXXX)
15
16colours=$(tput colors 2>/dev/null || echo "256")
17no_colour="\e[39;49m"
18green_colour="\e[32m"
19red_colour="\e[41;97m"
20bold="\e[1m"
21reset="\e[0m"
22use_colours=$(test -n "$colours" && test $colours -ge 8 && echo "yes")
23test "$use_colours" == "yes" || {
24 no_colour=""
25 green_colour=""
⋯5 lines
31
32example_name="Ubuntu/Xenial (16.04)"
33example_distro="ubuntu"
34example_codename="xenial"
35example_version="16.04"
36
37
38function e …
HTTP or HTTPS URL reference lines 53–62
53:32… u can contact ISC - Internet Systems Consortium for further assistance.${reset}"
54 echo -e "$prefix: "
55
56 echo -e "$prefix: ${bold}URL: https://gitlab.isc.org/isc-projects/kea${reset}"
57 echo -e "$prefix: "
58
59
60 test -f "$tmp_log" && {
61 local n=20
62 echo -e "$prefix: Last $n log lines from $tmp_log (might not …
xargs command usage lines 65–70
65:15… tool_silent "fmt" && {
66 tail -n $n $tmp_log | fmt -t | xargs -Ilog echo -e "$prefix: > log"
67 } || {
68 tail -n $n $tmp_log | xargs -Ilog echo -e "$prefix: > log"
69 }
70 …
Shell command-substitution syntax lines 93–115
93:3… return $rc
94}
95
96function echo_clearline {
97 local rc="$?"
98 echo -e -n "\033[1K\r"
99 return $rc
100}
⋯5 lines
106 local text="$4"
107 local help_text="$5"
108 local newline=$(test "$6" != "no" && echo "\n" || echo "")
109 local status_text=$(echo_green_or_red "$rc" "$good" "$bad")
110
111 echo_clearline
112 local width=$(test "$use_colours" == "yes" && echo "16" || echo "5")
113 printf "%${width}s %s${newline}" "${status_text}:" "$text"
114 test $rc -ne 0 && test ! -z "$help_text" && {
115 echo_h …
Assigns shell variable from positional parameter lines 125–135
125:30… UN" "$text" "" "no"
126 return $rc
127}
128
129function echo_okfail_rc {
130 local rc=$1
131 local text="$2"
132 local help_text="$3"
133 echo_clearline
134 echo_status $rc " OK" " NOPE" "$text" "$help_text"
135 re …

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.