remaster/src/func/chroot_is_mounted
2018-05-10 15:12:06 +02:00

21 lines
425 B
Bash

#!/bin/bash
#remaster lib
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }
#chroot_is_mounted [chroot_dir]
#(Boolean)-> true | false
function chroot_is_mounted() {
#$1 = chroot directory
#get state of _remaster from lxc
STATE=`lxc-ls _remaster_ -f -F STATE | tail -n 1 | sed 's/ //g'`
if [ "#$STATE#" == "#STOPPED#" ] ; then
#nothing running
echo "false"
else
#container is running
echo "true"
fi
}