-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhealthcheck.sh
executable file
·98 lines (84 loc) · 1.75 KB
/
healthcheck.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
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
check() {
if command -v $1 &> /dev/null; then
printf " $(tput setaf 10)✓ "
else
printf " $(tput setaf 9)✗ "
fi
printf "$1 $(tput sgr0)\n"
}
# check if snap enabled and installed
check-snap() {
if command -v snap &> /dev/null; then
printf " $(tput setaf 10)✓ snap"
else
if test -f "/etc/apt/preferences.d/nosnap.pref"; then
echo " $(tput setaf 10)✓ snap disabled$(tput sgr0)"
else
printf " $(tput setaf 9)✗ snap\n$(tput sgr0)"
fi
fi
}
echo "CLI base:"
check zsh
check nvim
check ctags
check tmux
check rg
check ag
check markdown
check cowsay
check jq
check gh
check diff-so-fancy
echo "Docker:"
check docker
check docker-compose
echo "Python:"
check python2
check python3
check pip
check pip2
check pip3
echo "Ruby:"
check ruby
check rbenv
echo "Erlang and Elixir:"
check kerl
check kiex
echo "JavaScript:"
check node
check npm
check n
check yarn
echo "Databases:"
check psql
check redis-server
check redis-cli
echo "GUI apps:"
check google-chrome
check telegram-desktop
check skypeforlinux
check slack
check discord
check insomnia
check postman
echo "Snap status:"
check-snap
printf "\nChecking shell:\n"
if [ -z "$RC_SOURCED" ]; then
echo " $(tput setaf 9)shell rc file is not sourced$(tput sgr0)"
else
echo " $(tput setaf 10)shell rc file is sourced$(tput sgr0)"
fi
if [ -z "$PROFILE_SOURCED" ]; then
echo " $(tput setaf 9)shell profile is not sourced, check if you are running login shell$(tput sgr0)"
else
echo " $(tput setaf 10)shell profile is sourced$(tput sgr0)"
# check dir tree if environment sourced
if [ -d $MY_FOLDER ]; then
echo " $(tput setaf 10)dir tree created$(tput sgr0)"
else
echo " $(tput setaf 9)dir tree is not created$(tput sgr0)"
fi
fi