21 lines
423 B
Bash
21 lines
423 B
Bash
#!/bin/sh
|
|
|
|
set -ex
|
|
|
|
: ${DOCKER_SVC:=${1:-docker}}
|
|
|
|
dropin=/etc/systemd/system/${DOCKER_SVC}.service.d/protect-system.conf
|
|
|
|
systemctl stop ${DOCKER_SVC}
|
|
if [ -f ${dropin} ]; then
|
|
mv ${dropin} ${dropin}.disabled
|
|
systemctl daemon-reload
|
|
fi
|
|
systemctl start ${DOCKER_SVC}
|
|
test -f /etc/docker/key.json
|
|
systemctl stop ${DOCKER_SVC}
|
|
if [ -f ${dropin}.disabled ]; then
|
|
mv ${dropin}.disabled ${dropin}
|
|
systemctl daemon-reload
|
|
fi
|