-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinst.sh
34 lines (34 loc) · 1.01 KB
/
inst.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env sh
# Copyright 2020-2022 (c) all rights reserved by S D Rausty; Please see LICENSE
# File `inst.sh` is under development
################################################################################
set -eu
_INST_() {
# check for neccessary commands: begin
COMMS="$1"
COMMANDR="$(command -v au)" || (printf "%s\\n\\n" "$STRING1")
COMMANDIF="${COMMANDR##*/}"
STRING1="COMMAND \`au\` enables rollback, available at https://wae.github.io/au/ IS NOT FOUND: Continuing... "
STRING2="Cannot update ~/${RDR##*/} prerequisite: Continuing..."
PKGS="$2"
_INPKGS_() {
if [ "$COMMANDIF" = au ]
then
au "$PKGS" || printf "%s\\n" "$STRING2"
else
apt install "$PKGS" || printf "%s\\n" "$STRING2"
fi
}
for COMMA in "$COMMS"
do
COMMANDP="$(command -v "$COMMA")" || printf "Command %s not found: Continuing...\\n" "$COMMA" # test if command exists
COMMANDPF="${COMMANDP##*/}"
if [ "$COMMANDPF" != "$COMMA" ]
then
printf "%s\\n" "Beginning buildAPKs \`$3\` setup:"
_INPKGS_
fi
done
# check for neccessary commands: end
}
# inst.sh EOF