summaryrefslogtreecommitdiff
path: root/fsmgr
diff options
context:
space:
mode:
Diffstat (limited to 'fsmgr')
-rwxr-xr-xfsmgr8
1 files changed, 8 insertions, 0 deletions
diff --git a/fsmgr b/fsmgr
new file mode 100755
index 0000000..06bb996
--- /dev/null
+++ b/fsmgr
@@ -0,0 +1,8 @@
1#!/bin/sh
2die() { printf 'Error: %s\n' "$*" >&2; exit 1; }
3root=$(stack path --local-install-root) || die "subcommand failed: 'stack path'"
4bin=$root/bin/fsmgr
5case "$(id -u)" in
6 0) exec "$bin" "$@" ;;
7 *) exec sudo -- "$bin" "$@" ;;
8esac