I have to enable, start, stop and restart docker in a bash script.
The problem is that the command's are executed with an ssh-connection. So after executing the command the ssh-connection closes. So there is not enough time to start and stop docker. I get this error:

> 
> start request repeated too quickly for docker.service
> 
> 
> 

How can I prevent this?
Is it possible to perform a `sleep` in the same command 

```
 ${SSHKEY}$i sudo systemctl start docker
 ${SSHKEY}$i sleep 4

```

The above does not work because the connection closes.
I tried:

```
${SSHKEY}$i sudo systemctl start docker; sleep 1

```

But didn't seem to work because the connection closes immediately after the first command .