@cryptotaxi247 / netdata-1 / commits / e63b165f0

allow users to give the directory to keep the netdata source and to disable cron updates; fixes #2342

Costa Tsaousis (ktsaou) committed Jun 18, 2017 at 01:19 UTC e63b165f051272d0b9c893074932eb30bd0f0aca
1 file changed +18 -3
kickstart.sh
+18 -3
@@ -8,6 +8,11 @@
8 #
9 # bash <(curl -Ss https://my-netdata.io/kickstart.sh) all
10 #
11 +# Other options:
12 +# --src-dst PATH keep netdata.git at PATH/netdata.git
13 +# --dont-wait do not prompt for user input
14 +# --non-interactive do not prompt for user input
15 +# --no-updates do not install script for daily updates
16 #
17 # This script will:
18 #
@@ -221,6 +226,8 @@ sudo=""
226 INTERACTIVE=1
227 PACKAGES_INSTALLER_OPTIONS="netdata"
228 NETDATA_INSTALLER_OPTIONS=""
229 +NETDATA_UPDATES="-u"
230 +SOURCE_DST="/usr/src"
231 while [ ! -z "${1}" ]
232 do
233 if [ "${1}" = "all" ]
@@ -231,6 +238,16 @@ do
238 then
239 INTERACTIVE=0
240 shift 1
241 + elif [ "${1}" = "--src-dst" -o "${1}" = "--src-dir" ]
242 + then
243 + SOURCE_DST="${2}"
244 + echo >&2 "netdata source will be installed at ${SOURCE_DST}/netdata.git"
245 + shift 2
246 + elif [ "${1}" = "--no-updates" ]
247 + then
248 + echo >&2 "netdata will not auto-update"
249 + NETDATA_UPDATES=
250 + shift 1
251 else
252 break
253 fi
@@ -304,8 +321,6 @@ git="$(which_cmd git)"
321 NETDATA_SOURCE_DIR=
322 if [ ! -z "${git}" -a -x "${git}" ]
323 then
307 - SOURCE_DST="/usr/src"
308 -
324 [ ! -d "${SOURCE_DST}" ] && run ${sudo} mkdir -p "${SOURCE_DST}"
325
326 if [ ! -d "${SOURCE_DST}/netdata.git" ]
@@ -347,7 +362,7 @@ then
362 if [ -x netdata-installer.sh ]
363 then
364 progress "Installing netdata..."
350 - run ${sudo} ./netdata-installer.sh -u ${NETDATA_INSTALLER_OPTIONS} "${@}" || \
365 + echo ${sudo} ./netdata-installer.sh ${NETDATA_UPDATES} ${NETDATA_INSTALLER_OPTIONS} "${@}" || \
366 fatal "netdata-installer.sh exited with error"
367 else
368 fatal "Cannot install netdata from source (the source directory does not include netdata-installer.sh)."