fix for installing macos plist file
Costa Tsaousis (ktsaou) committed
May 8, 2018 at 11:23 UTC
eb70be2e55fbf32553299424204d752213913694
2 files changed
+11
-12
.gitignore
+1
@@ -72,6 +72,7 @@ system/netdata-openrc
72
system/netdata-init-d
73
system/netdata.logrotate
74
system/netdata.service
75
+system/netdata.plist
76
system/netdata-freebsd
77
78
# installer generated files
installer/functions.sh
+10
-12
@@ -493,16 +493,6 @@ install_non_systemd_init() {
493
then
494
echo >&2 "file '/etc/init.d/netdata' already exists."
495
return 0
496
- elif [[ "${key}" =~ ^MacOS.* ]]
497
- then
498
- if [ -f "/Library/LaunchDaemons/com.github.netdata.plist" ]
499
- then
500
- echo >&2 "file '/Library/LaunchDaemons/com.github.netdata.plist' already exists."
501
- else
502
- echo >&2 "Installing MacOS X plist file..."
503
- run cp system/netdata.plist /Library/LaunchDaemons/com.github.netdata.plist && \
504
- run launchctl load /Library/LaunchDaemons/com.github.netdata.plist
505
- fi
496
else
497
echo >&2 "I don't know what init file to install on system '${key}'. Open a github issue to help us fix it."
498
fi
@@ -521,8 +511,16 @@ install_netdata_service() {
511
if [ "${uname}" = "Darwin" ]
512
then
513
524
- echo >&2 "hm... I don't know how to install a startup script for MacOS X"
525
- return 1
514
+ if [ -f "/Library/LaunchDaemons/com.github.netdata.plist" ]
515
+ then
516
+ echo >&2 "file '/Library/LaunchDaemons/com.github.netdata.plist' already exists."
517
+ return 0
518
+ else
519
+ echo >&2 "Installing MacOS X plist file..."
520
+ run cp system/netdata.plist /Library/LaunchDaemons/com.github.netdata.plist && \
521
+ run launchctl load /Library/LaunchDaemons/com.github.netdata.plist && \
522
+ return 0
523
+ fi
524
525
elif [ "${uname}" = "FreeBSD" ]
526
then