-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·62 lines (48 loc) · 1.11 KB
/
install.sh
File metadata and controls
executable file
·62 lines (48 loc) · 1.11 KB
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
#!/bin/bash
# Program:
# Install
# Version:
# 1.0.7
# History:
# Created on 2018/07/16
# Last modified on 2023/09/05
# Author:
# kwkw
echo_log()
{
echo $(date +"%Y-%m-%d %H:%M:%S") $1
}
echo_log "Loading tools..."
. ./tools.sh
echo_log "Install sudo..."
$PM -y install sudo
echo_log "Set sudo"
SUDO="sudo"
echo_log "Install docker..."
$SUDO $PM -y install curl && $SUDO curl -fsSL https://get.docker.com/ | sh
echo_log "Start docker..."
$SUDO systemctl start docker
echo_log "Set up docker to boot"
$SUDO systemctl enable docker
# Install epel-release
if [ "$PM" = "yum" ]
then
echo_log "Install epel-release..."
$SUDO $PM -y install epel-release
fi
echo_log "Install bash-completion..."
$SUDO $PM -y install bash-completion
echo_log "Copy dockerSH-completion.bash"
$SUDO cp dockerSH-completion.bash /etc/bash_completion.d/
# Set bash completion in zsh
echo $SHELL | grep zsh > /dev/null
if [ $? -eq 0 ]
then
echo_log "Set bash completion in zsh"
cat << EOF >> ~/.zshrc
# dockerSH
autoload bashcompinit
bashcompinit
source /etc/bash_completion.d/dockerSH-completion.bash
EOF
fi