-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpleif.sh
More file actions
executable file
·59 lines (31 loc) · 852 Bytes
/
simpleif.sh
File metadata and controls
executable file
·59 lines (31 loc) · 852 Bytes
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
#!/usr/bin/env bash
<< simpleif
#which docker && { echo "Docker is intalled on this host" ; echo "The docker version is: $(docker -v)" ; }
if which docker 2>/dev/null 1>/dev/null
then
echo "Docker is intalled on this host"
echo "The docker version is: $(docker -v)"
fi
which docker 2>&1 1>/dev/null
if [[ $? -eq 0 ]]
then
echo "Docker is intalled on this host"
echo "The docker version is: $(docker -v)"
fi
if true
then
echo "Always this will execute"
fi
if false
then
echo "It wont execute"
fi
simpleif
#which apache2 2>&1 1>/dev/null && { echo "Apache is installed" ; echo "apache versin info is: $(apache2 -v)" ; } || echo "apache is not installed"
if which apache2 2>&1 1>/dev/null
then
echo "Apache is installed"
echo "apache versin info is: $(apache2 -v)"
else
echo "apache is not installed"
fi