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

Correct test for path starting with /hosthome/

parent d6c79901
No related branches found
No related tags found
No related merge requests found
...@@ -2,4 +2,5 @@ if [ ${#} -ne 1 ]; then ...@@ -2,4 +2,5 @@ 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
fi fi
docker exec -it dsconfig python -m dsconfig.dump > ${1} docker exec -it dsconfig python -m dsconfig.dump > ${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: # Check if the filename begins with /hosthome/:
elif [ ${1##/hosthome/} != ${1//\/hosthome\//} ]; then elif [ ${1:0:10} != /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." 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 exit -2
fi fi
docker exec -it ${TANGO_CONTAINER_ENV} 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: # Check if the filename begins with /hosthome/:
elif [ ${1##/hosthome/} != ${1//\/hosthome\//} ]; then elif [ ${1:0:10} != /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." 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 exit -2
fi fi
docker exec -it ${TANGO_CONTAINER_ENV} 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