summaryrefslogtreecommitdiff
path: root/fsmgr
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2018-07-09 18:50:58 -0400
committerAndrew Cady <d@jerkface.net>2018-07-09 19:29:37 -0400
commit233641f7601c35ccc932435742f52d3b99a4d2f0 (patch)
tree8f763698557835f8f698c20033881dbddc6bccac /fsmgr
parentdb279470ddaafcafd9e9c28ef41f2eab1a904ead (diff)
script to run fsmgr from local dir
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