Debian Codegraph @

plugins/suedit

raw
1 #!/usr/bin/env sh
2
3 # Description: Edit file as superuser
4 #
5 # Shell: POSIX compliant
6 # Author: Anna Arad
7
8 EDITOR="${EDITOR:-vim}"
9
10 if type sudoedit >/dev/null 2>&1; then
11 sudoedit "$1"
12 elif type sudo >/dev/null 2>&1; then
13 sudo -E "$EDITOR" "$1"
14 elif type doas >/dev/null 2>&1; then
15 doas "$EDITOR" "$1"
16 fi