From c32179f8d7db1810ebbbf4966696def24c117226 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 29 Jul 2016 22:46:13 +0100 Subject: [PATCH] chroot --- src/freedombone-app-tox | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/freedombone-app-tox b/src/freedombone-app-tox index 353a4c02..09327155 100755 --- a/src/freedombone-app-tox +++ b/src/freedombone-app-tox @@ -593,9 +593,16 @@ function mesh_tox_client { echo $"Toxic client compile $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed." # create a tox user - if [ ! -f /home/${MY_USERNAME}/.config/tox/data.tox ]; then - toxid -u $MY_USERNAME -n data - chown -R ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/.config + if [ ${rootdir} ]; then + if [ ! -f ${rootdir}/home/${MY_USERNAME}/.config/tox/data.tox ]; then + chroot ${rootdir} toxid -u $MY_USERNAME -n data + chroot ${rootdir} chown -R ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/.config + fi + else + if [ ! -f /home/${MY_USERNAME}/.config/tox/data.tox ]; then + toxid -u $MY_USERNAME -n data + chown -R ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/.config + fi fi }