-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcropduster.sh
73 lines (58 loc) · 1.59 KB
/
cropduster.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
# https://github.com/maximuskowalski/maxmisc/blob/master/cropduster.sh
# a crop installer
# https://github.com/l3uddz/crop
set -Eeuo pipefail
IFS=$'\n\t'
# Grab service files? - user problem?
# config... too hard for now
#________ VARS
APP=crop
APPDIR=/opt
#________ DONT CHANGE
MNTPNT=${APPDIR}/${APP}
#________ FUNCTIONS
rooter() {
if [ "$(whoami)" = root ]; then
echo "${BRED} Running as root or with sudo is not supported. Exiting.${RESET}"
exit
fi
}
checkoff() {
([ -d "${MNTPNT}" ] || dirmkr)
}
dirmkr() {
sudo mkdir -p "${MNTPNT}" && sudo chown "${USER}":"${USER}" "${MNTPNT}"
}
fetching() {
wget -c https://github.com/l3uddz/crop/releases/download/v1.0.1/crop_v1.0.1_linux_amd64 -O ${MNTPNT}/crop
chmod +x ${MNTPNT}/crop
wget -c https://raw.githubusercontent.com/maximuskowalski/getw/main/files/lclone -O ${MNTPNT}/lclone
chmod +x ${MNTPNT}/lclone
wget -c https://raw.githubusercontent.com/maximuskowalski/getw/main/files/crop_config_sample.yml -O ${MNTPNT}/config.yaml.sample
}
messaging() {
echo
echo " For documentation see"
echo " https://github.com/l3uddz/crop"
echo
echo " a sample configuration is files is located here"
echo " ${MNTPNT}/config.yaml.sample"
echo " copy and edit or create ${MNTPNT}/config.yaml"
echo
}
fin() {
echo
echo " **************************"
echo " * ---------------------- *"
echo " * - install completed! - *"
echo " * ---------------------- *"
echo " **************************"
echo
}
#________ RUNLIST
rooter
checkoff
fetching
messaging
fin