diff options
author | Andrew Cady <d@jerkface.net> | 2018-07-09 18:50:58 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2018-07-09 19:29:37 -0400 |
commit | 233641f7601c35ccc932435742f52d3b99a4d2f0 (patch) | |
tree | 8f763698557835f8f698c20033881dbddc6bccac /fsmgr | |
parent | db279470ddaafcafd9e9c28ef41f2eab1a904ead (diff) |
script to run fsmgr from local dir
Diffstat (limited to 'fsmgr')
-rwxr-xr-x | fsmgr | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/sh | ||
2 | die() { printf 'Error: %s\n' "$*" >&2; exit 1; } | ||
3 | root=$(stack path --local-install-root) || die "subcommand failed: 'stack path'" | ||
4 | bin=$root/bin/fsmgr | ||
5 | case "$(id -u)" in | ||
6 | 0) exec "$bin" "$@" ;; | ||
7 | *) exec sudo -- "$bin" "$@" ;; | ||
8 | esac | ||