diff --git a/src/freedombone-utils-filesystem b/src/freedombone-utils-filesystem index 61837f07..30fe7958 100755 --- a/src/freedombone-utils-filesystem +++ b/src/freedombone-utils-filesystem @@ -32,63 +32,63 @@ TOMB_REPO="https://github.com/dyne/Tomb" TOMB_COMMIT='c80ebd6d6ed77980eb5b559757e03ea13a29bdd1' function mesh_install_tomb { - chroot ${rootdir} apt-get -y install cryptsetup zsh pinentry-curses + chroot ${rootdir} apt-get -y install cryptsetup zsh pinentry-curses - if [ ! -d ${rootdir}/$INSTALL_DIR ]; then - mkdir -p ${rootdir}/$INSTALL_DIR - fi + if [ ! -d ${rootdir}/$INSTALL_DIR ]; then + mkdir -p ${rootdir}/$INSTALL_DIR + fi - git_clone $TOMB_REPO ${rootdir}/$INSTALL_DIR/tomb - cd ${rootdir}/$INSTALL_DIR/tomb + git_clone $TOMB_REPO ${rootdir}/$INSTALL_DIR/tomb + cd ${rootdir}/$INSTALL_DIR/tomb - git checkout $TOMB_COMMIT -b $TOMB_COMMIT + git checkout $TOMB_COMMIT -b $TOMB_COMMIT - chroot ${rootdir} /bin/bash -x <> $COMPLETION_FILE - else - sed -i "s/Tomb commit.*/Tomb commit:$TOMB_COMMIT/g" $COMPLETION_FILE - fi + git checkout $TOMB_COMMIT -b $TOMB_COMMIT + if ! grep -q "tomb commit" $COMPLETION_FILE; then + echo "tomb commit:$TOMB_COMMIT" >> $COMPLETION_FILE + else + sed -i "s/tomb commit.*/tomb commit:$TOMB_COMMIT/g" $COMPLETION_FILE + fi - make install - if [ ! -f /usr/local/bin/tomb ]; then - exit 93462 - fi + make install + if [ ! -f /usr/local/bin/tomb ]; then + exit 93462 + fi - echo 'install_tomb' >> $COMPLETION_FILE + echo 'install_tomb' >> $COMPLETION_FILE } # NOTE: deliberately no exit 0