Skip to content
Snippets Groups Projects
Commit 5671731b authored by Thomas Juerges's avatar Thomas Juerges
Browse files

Add check that filename begins with /hosthome

This ensures that the file can be store in the host ${HOME} dir
outside of the container.

Also added ${TANGO_CONTAINER_ENV} that sets environment variables
parent 576b8ff7
No related branches found
No related tags found
No related merge requests found
if [ ${#} -ne 1 ]; then if [ ${#} -ne 1 ]; then
echo "You must provide a file name for the TANGO_HOST DB dump!" echo "You must provide a file name for the TANGO_HOST DB dump!"
exit -1 exit -1
# Check if the filename begins with /hosthome:
elif [ ${1##/hosthome/} != ${1//\/hosthome\//} ]; then
echo "You must provide a filename that begins with \"/hosthome/\". Why is that? Because the file needs to be stored from within the container to the hosts file system and your HOME directory will be mounted as /hosthome."
exit -2
fi fi
docker exec -it dsconfig json2tango --write ${1} docker exec -it ${TANGO_CONTAINER_ENV} dsconfig json2tango --write ${1}
if [ ${#} -ne 1 ]; then if [ ${#} -ne 1 ]; then
echo "You must provide a file name for the TANGO_HOST DB dump!" echo "You must provide a file name for the TANGO_HOST DB dump!"
exit -1 exit -1
# Check if the filename begins with /hosthome:
elif [ ${1##/hosthome/} != ${1//\/hosthome\//} ]; then
echo "You must provide a filename that begins with \"/hosthome/\". Why is that? Because the file needs to be stored from within the container to the hosts file system and your HOME directory will be mounted as /hosthome."
exit -2
fi fi
docker exec -it dsconfig json2tango --update ${1} docker exec -it ${TANGO_CONTAINER_ENV} dsconfig json2tango --update ${1}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment