mirror of
https://github.com/kuhyx/testsAndMisc-archive.git
synced 2026-11-11 12:07:34 +01:00
feat: add install unreal mcp script
This commit is contained in:
parent
fef44f0015
commit
5a34d9aae4
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Post-transaction hook to re-apply hosts guard protections (single-layer ro bind)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TARGET=/etc/hosts
|
||||
ENFORCE=/usr/local/sbin/enforce-hosts.sh
|
||||
LOGTAG=hosts-guard-hook
|
||||
@ -8,7 +10,7 @@ LOGTAG=hosts-guard-hook
|
||||
mount_layers_count() { awk '$5=="/etc/hosts"{c++} END{print c+0}' /proc/self/mountinfo 2> /dev/null || echo 0; }
|
||||
collapse_mounts() {
|
||||
local i=0
|
||||
if command -v mountpoint > /devnull 2>&1; then
|
||||
if command -v mountpoint > /dev/null 2>&1; then
|
||||
while mountpoint -q "$TARGET"; do
|
||||
umount -l "$TARGET" > /dev/null 2>&1 || break
|
||||
i=$((i + 1))
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Non-interactive pre-transaction hook to temporarily unlock /etc/hosts
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
TARGET=/etc/hosts
|
||||
LOGTAG=hosts-guard-hook
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user