kolla-ansible/tools/validate-docker-execute
Swapnil Kulkarni 1f0acbd0cd Update scripts to check if docker is usable for $USER
Added new script for checking user permissions on
docker command execution

Change-Id: I3b727590d9a29f416f5b847912b7250c555c2333
Closes-Bug: #1473554
2015-07-14 09:38:49 +00:00

15 lines
384 B
Bash
Executable File

#!/bin/bash
#
# This script can be used to check user privilege to execute
# docker commands
function check_dockerexecute {
docker ps &>/dev/null
return_val=$?
if [ $return_val -ne 0 ]; then
echo "User $USER can't seem to run Docker commands. Verify product documentation to allow user to execute docker commands" 1>&2
exit 1
fi
}
check_dockerexecute