summaryrefslogtreecommitdiffstats
path: root/system/edit-config.in
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsystem/edit-config.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/system/edit-config.in b/system/edit-config.in
index 1b86549fa..abfd5a454 100755
--- a/system/edit-config.in
+++ b/system/edit-config.in
@@ -4,7 +4,12 @@
file="${1}"
-EDITOR="${EDITOR-vi}"
+if [ "$(command -v editor)" ] ; then
+ EDITOR="${EDITOR-editor}"
+else
+ EDITOR="${EDITOR-vi}"
+fi
+
[ -z "${NETDATA_USER_CONFIG_DIR}" ] && NETDATA_USER_CONFIG_DIR="@configdir_POST@"
[ -z "${NETDATA_STOCK_CONFIG_DIR}" ] && NETDATA_STOCK_CONFIG_DIR="@libconfigdir_POST@"