about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorAlexey Yerin <yyp@disroot.org>2025-03-21 14:57:38 +0300
committerAlexey Yerin <yyp@disroot.org>2025-03-21 14:57:38 +0300
commit1f81aa0bbfd363b1d264b5b19ef086b5bdd1260e (patch)
tree51171590e0f31292f61778783a3e7d2ab0c7de65 /scripts
parent100753a060bebb9ad33a2b56722a4e83faba3fea (diff)
Improve install and uninstall tasks
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-modules10
-rwxr-xr-xscripts/uninstall-modules9
2 files changed, 19 insertions, 0 deletions
diff --git a/scripts/install-modules b/scripts/install-modules
new file mode 100755
index 0000000..5f61004
--- /dev/null
+++ b/scripts/install-modules
@@ -0,0 +1,10 @@
+#!/bin/sh -eu
+
+install_dir="$1"
+shift
+
+for mod; do
+	printf "installing %s\n" "$mod"
+	mkdir -p "$install_dir/$mod"
+	install -m644 "$mod"/* "$install_dir/$mod"
+done
diff --git a/scripts/uninstall-modules b/scripts/uninstall-modules
new file mode 100755
index 0000000..545c19d
--- /dev/null
+++ b/scripts/uninstall-modules
@@ -0,0 +1,9 @@
+#!/bin/sh -eu
+
+install_dir="$1"
+shift
+
+for mod; do
+	printf "uninstalling %s\n" "$mod"
+	rm -r "$install_dir/$mod"
+done