rwx/sh/mount-lxc.sh

32 lines
673 B
Bash
Raw Normal View History

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