mirror of
https://github.com/kuhyx/testsAndMisc-archive.git
synced 2026-11-10 19:27:05 +01:00
- Move fresh-install/ → scripts/single_use/fresh-install/ - Move hosts/ → scripts/periodic_background/hosts/ - Move i3-configuration/ → scripts/periodic_background/i3-configuration/ - Delete linux_configuration/LaTeX/, nix-poc/, report/ (dead dirs) - Move repo-root scripts/ → meta/scripts/ - Update root .pre-commit-config.yaml: scripts/ → meta/scripts/ (9 entries) - Update run.sh ARTIFACT_INIT_SCRIPT to meta/scripts/ - Update fresh-install/main.sh: hosts/install.sh + i3-configuration/install.sh paths - Update check_python_location.sh: add meta/scripts/ to exception list - Fix midnight flakiness in test_recent_workout_returns_true: use timezone-aware local noon instead of now-1h to avoid SQL date() boundary issues
32 lines
811 B
Bash
Executable File
32 lines
811 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# pacman-pre-unlock-hosts.sh - Temporarily unlock guarded config files before pacman
|
|
# Unlocks: /etc/hosts, /etc/nsswitch.conf, /etc/systemd/resolved.conf
|
|
set -euo pipefail
|
|
|
|
# Source shared functions
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
# shellcheck source=hosts-guard-common.sh
|
|
source "$SCRIPT_DIR/hosts-guard-common.sh"
|
|
|
|
require_root
|
|
|
|
log_hook "pre" "unlocking(start)"
|
|
|
|
# Remove protective attributes from all guarded files
|
|
remove_all_guard_attrs
|
|
|
|
# Stop guard services (hosts, nsswitch, resolved watchers)
|
|
stop_units_if_present
|
|
|
|
# Collapse any existing mount layers
|
|
collapse_mounts
|
|
|
|
# Ensure writable by remounting if still read-only
|
|
if is_ro_mount; then
|
|
mount -o remount,rw "$TARGET" >/dev/null 2>&1 || collapse_mounts
|
|
fi
|
|
|
|
log_hook "pre" "unlocking(done)"
|
|
|
|
exit 0
|