You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
504 B
25 lines
504 B
#!/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 |
|
} |
|
|
|
#this func is standalone executable |
|
[ -n "$1" ] && { |
|
chroot_is_mounted $@ |
|
}
|
|
|