sh/bash/mount-lxc.sh

32 lines
697 B
Bash
Raw Normal View History

2024-11-12 08:43:56 +00:00
mrc() {
2023-05-09 20:02:34 +00:00
local container="${1}"
local f
2024-11-12 08:43:56 +00:00
for f in "dev" "dev/pts" "proc" "sys" ; do
2023-05-09 20:02:34 +00:00
mount --bind "/${f}" "overlay/mount/var/lib/lxc/${container}/squashfs-root/${f}"
done
}
2024-11-12 08:43:56 +00:00
crc() {
2023-05-09 20:02:34 +00:00
local container="${1}"
shift
chroot "overlay/mount/var/lib/lxc/${container}/squashfs-root" "${@}"
}
2024-11-12 08:43:56 +00:00
urc() {
2023-05-09 20:02:34 +00:00
local container="${1}"
2024-11-12 08:43:56 +00:00
for f in "sys" "proc" "dev/pts" "dev" ; do
2023-05-09 20:02:34 +00:00
umount --lazy "overlay/mount/var/lib/lxc/${container}/squashfs-root/${f}"
done
}
2024-11-12 08:43:56 +00:00
mmc() {
2023-05-09 20:02:34 +00:00
local container="${1}"
2024-11-12 08:43:56 +00:00
mount --bind "/deb" "overlay/mount/var/lib/lxc/${container}/squashfs-root/deb"
2023-05-09 20:02:34 +00:00
}
2024-11-12 08:43:56 +00:00
umc() {
2023-05-09 20:02:34 +00:00
local container="${1}"
umount "overlay/mount/var/lib/lxc/${container}/squashfs-root/deb"
}