-
Notifications
You must be signed in to change notification settings - Fork 0
/
devops_command.sh
executable file
·82 lines (75 loc) · 1.57 KB
/
devops_command.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
#!/bin/bash
# Install devops-command-tools
# By Tedezed
OPTION=$1
if [ -z "$OPTION" ]; then
echo "[ERROR] Need input: --install or --uninstall"
exit 1
fi
#ls ./* | grep -v "\.\/*"
list_scripts="
apt-http
dtags
entrypointd
gcloud_bucket_project
gcloud_bucket_iam
gcloud_cold_disk
gcloud_cp_disk
gcloud_kill_disk
killgrep
kall
kcontext
kdelforce
kexec
kndefault
kscale
ksecret
outputlog
pomodoro
tarparts
trycommand
"
# ls -d */
list_install_docker="
apt-http/apt-http
docker/dtags
entrypointd/entrypointd
kubernetes/kall
kubernetes/kcontext
kubernetes/kdelforce
kubernetes/kexec
kubernetes/kexecronjob
kubernetes/kndefault
kubernetes/kscale
kubernetes/ksecret
logger/outputlog
tarparts/tarparts
trycommand/trycommand
"
if [ "$OPTION" == "--install" ]; then
echo "[INFO] Dependency installation"
# Kubernetes
sudo apt-get install jq kubectl
# Pomodoro
sudo apt-get install pulseaudio-utils soxt
echo "[INFO] Copy to /usr/bin/"
sudo cp */* /usr/bin/
elif [ "$OPTION" == "--install-docker" ]; then
for script in $list_install_docker;
do
dir_name=$(echo $script | cut -d '/' -f1)
script_name=$(echo $script | cut -d '/' -f2)
curl -SL https://raw.githubusercontent.com/Tedezed/devops-command-tools/master/$script \
-o /usr/bin/$script_name
done
elif [ "$OPTION" == "--uninstall" ]; then
for script in $list_scripts;
do
if [ -f "/usr/bin/$script" ]; then
echo "[INFO] Remove /usr/bin/$script"
sudo rm -f /usr/bin/$script
fi
done
else
echo "[ERROR] invalid input"
fi