nandi/memwatchpublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/nandi/memwatch.git
git clone ssh://git@rickub.com/nandi/memwatch.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

add memwatch control wrapper 83ca73b · on main · nandithebull · 3h ago
install.sh · 24 lines · 1017 BBash Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
set -euo pipefail
[[ $EUID -eq 0 ]] || { echo "run as root: run0 ./install.sh" >&2; exit 1; }
src="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

install -Dm755 "$src/src/memwatchd.py" /usr/local/lib/memwatch/memwatchd.py
install -Dm644 "$src/units/memwatch.service" /etc/systemd/system/memwatch.service
install -Dm644 "$src/README.md" /usr/share/doc/memwatch/README.md
install -Dm755 "$src/bin/memwatch" /usr/local/bin/memwatch
if [[ -e /etc/memwatch.conf ]]; then
  install -Dm644 "$src/memwatch.conf" /etc/memwatch.conf.new
  echo "kept your /etc/memwatch.conf; new defaults at /etc/memwatch.conf.new"
else
  install -Dm644 "$src/memwatch.conf" /etc/memwatch.conf
fi

systemctl daemon-reload
systemctl enable --now memwatch.service
echo
systemctl --no-pager --lines=15 status memwatch.service || true
echo
echo "Running in dry_run mode. Watch it with:  journalctl -fu memwatch"
echo "When the picks look right, set dry_run = 0 in /etc/memwatch.conf"
echo "and run: systemctl restart memwatch"