forked from Jimmy01240397/LDAPUserTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
50 lines (46 loc) · 970 Bytes
/
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
#!/bin/bash
set -e
UBUNTU=false
DEBIAN=false
if [ "$(uname)" = "Linux" ]
then
#LINUX=1
if type apt-get
then
OS_ID=$(lsb_release -is)
if [ "$OS_ID" = "Debian" ]; then
DEBIAN=true
else
UBUNTU=true
fi
fi
fi
if [ "$(uname)" = "Linux" ]
then
#LINUX=1
if $UBUNTU || $DEBIAN
then
# DEBIAN or Ubuntu
echo "Installing on DEBIAN or Ubuntu."
set +e
sudo apt-get update
set -e
sudo apt-get install -y curl wget ldap-utils libarchive-zip-perl jq
arch=$(dpkg --print-architecture)
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_${arch}.tar.gz -O - | tar xz && sudo mv yq_linux_${arch} /usr/local/bin/yq
else
echo "os not support"
exit 0
fi
else
echo "os not support"
exit 0
fi
for a in $(ls | grep -P "^ldap.*\.sh" | grep -v "$(echo "$0" | sed "s/^.*\///g")")
do
chmod +x $a
ln -s $(pwd)/$a /usr/local/bin/$(echo "$a" | sed "s/\.sh//g")
done
echo ""
echo ""
echo "LDAP User Tools install.sh complete."