2015-07-13 07:11:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This script can be used to check user privilege to execute
|
|
|
|
# docker commands
|
|
|
|
|
|
|
|
function check_dockerexecute {
|
2019-04-09 11:59:02 +00:00
|
|
|
sudo docker ps &>/dev/null
|
2015-07-13 07:11:27 +00:00
|
|
|
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
|