mirror of
https://github.com/kuhyx/scripts.git
synced 2026-07-04 15:23:11 +02:00
hosts file monitor
This commit is contained in:
parent
356508722e
commit
3048b4b48d
14
scripts/system-maintenance/bin/browser-preexec-wrapper.sh
Normal file → Executable file
14
scripts/system-maintenance/bin/browser-preexec-wrapper.sh
Normal file → Executable file
@ -9,6 +9,20 @@ HOSTS_INSTALL_SCRIPT="__HOSTS_INSTALL_SCRIPT__"
|
||||
prog_name="$(basename "$0")"
|
||||
real_bin="/usr/bin/${prog_name}"
|
||||
|
||||
# If run directly (not via a browser symlink) or if the target binary doesn't exist,
|
||||
# allow passing the real browser command as the first argument for testing:
|
||||
if [[ ! -x "$real_bin" || "$prog_name" == "browser-preexec-wrapper.sh" ]]; then
|
||||
if [[ $# -ge 1 ]]; then
|
||||
real_bin="$1"
|
||||
shift
|
||||
else
|
||||
echo "Error: could not resolve real browser binary for '$prog_name'." >&2
|
||||
echo "Usage (testing): $0 <real-browser-command> [args...]" >&2
|
||||
echo "Typical install: symlink this script as /usr/local/bin/<browser> so it wraps /usr/bin/<browser>." >&2
|
||||
exit 127
|
||||
fi
|
||||
fi
|
||||
|
||||
# Best-effort: install hosts file quietly; don't block browser startup
|
||||
if command -v sudo >/dev/null 2>&1; then
|
||||
sudo -n "$HOSTS_INSTALL_SCRIPT" >/dev/null 2>&1 || true
|
||||
|
||||
0
scripts/system-maintenance/bin/hosts-file-monitor.sh
Normal file → Executable file
0
scripts/system-maintenance/bin/hosts-file-monitor.sh
Normal file → Executable file
0
scripts/system-maintenance/bin/periodic-system-maintenance.sh
Normal file → Executable file
0
scripts/system-maintenance/bin/periodic-system-maintenance.sh
Normal file → Executable file
Loading…
Reference in New Issue
Block a user