-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·87 lines (76 loc) · 1.87 KB
/
install.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
# Install script for yap created manually.
# Pre-Reqs: gawk, GNUcore-utils, findutils, git, gcc, tar
#
# Builded structures:
# directories:
# /usr/local/lib/bash/5.17/yap
# specific files:
# /usr/bin/yap
# Ey peygamber! Eşlerine şöyle de: “Dünya hayatını ve güzelliklerini istiyorsanız gelin size bir şeyler vereyim sonra da güzellikle sizi serbest bırakayım.
# Yok eğer Allah’ı, resulünü ve âhiret yurdunu istiyorsanız şunu bilin ki Allah, içinizden güzel davrananlara büyük bir ödül hazırlamıştır.” --ahzab 28-29
export cwd="${PWD}"
[[ "${UID}" != 0 ]] && { echo "Run this with root privalages!" ; exit 1 ;}
die() {
echo "${1}"
exit "${2}"
}
check() {
echo -n "checking for '${1}'.. "
command -v "${1}" &> /dev/null && echo "ok" || die "no" "$?"
}
# it does not cover the dependencies of dependencies
check git
check tar
check gcc
check install
check awk
check mktemp
check xargs
check chmod
check chown
check cp
check ln
check ls
check mkdir
check mv
check rm
check rmdir
check touch
check basename
check cat
check comm
check cut
check dirname
check echo
check expand
check false
check true
check head
check seq
check sort
check tail
check tee
check tr
check uniq
check wc
check env
check date
# if you can't pass this stage then try to install 'Pre-Reqs'.
echo -n "checking for 'bash-utils'.. "
if ! ls /usr/local/lib/bash/5.17/{alternatives,colorsh,osutils,tuiutils}.sh &> /dev/null ; then
echo "no"
git clone "https://github.com/themispkg/bash-utils"
cd "bash-utils"
make install || die "could not getting 'bash-utils'" "$?"
cd "${cwd}"
else
echo "ok"
fi
echo -n "creating directories.. "
mkdir -p /usr/local/lib/bash/5.17/yap
echo "ok"
echo -n "installing libraries and triggers.. "
install -m 755 ./src/*.sh /usr/local/lib/bash/5.17/yap
install -m 777 ./yap.sh /usr/bin/yap
echo "ok"