-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartdockeer.sh
More file actions
executable file
·30 lines (26 loc) · 772 Bytes
/
Copy pathstartdockeer.sh
File metadata and controls
executable file
·30 lines (26 loc) · 772 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
#!/usr/bin/env bash
if [[ $(id -u) -eq 0 ]]
then
if systemctl status docker 1>/dev/null 2>/dev/null
then
echo "Already docker is up and running"
else
echo "Starting docker service...."
systemctl start docker
echo "Successfully started docker service"
fi
else
if sudo -v 1>/dev/null 2>/dev/null
then
if systemctl status docker 1>/dev/null 2>/dev/null
then
echo "Already docker is up and running"
else
echo "Starting docker service...."
sudo systemctl start docker
echo "Successfully started docker service"
fi
else
echo "Sorry, you are not allowed to start docker service, because you are not the root user and also you dont have suod previlages to start it"
fi
fi