summaryrefslogtreecommitdiffstats
path: root/system/edit-config
diff options
context:
space:
mode:
Diffstat (limited to 'system/edit-config')
-rw-r--r--system/edit-config7
1 files changed, 6 insertions, 1 deletions
diff --git a/system/edit-config b/system/edit-config
index 1696f9f3..e7f50e76 100644
--- a/system/edit-config
+++ b/system/edit-config
@@ -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="/usr/local/etc/netdata"
[ -z "${NETDATA_STOCK_CONFIG_DIR}" ] && NETDATA_STOCK_CONFIG_DIR="/usr/local/lib/netdata/conf.d"