aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/macos/increase_limits.sh
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@qt.io>2019-09-12 01:12:18 +0200
committerDimitrios Apostolou <jimis@qt.io>2019-09-27 08:42:37 +0200
commit89f6db8c2232b543aaebfe1ba8d9ba8d3a7fc177 (patch)
tree8c542e3cbf4570473f8e4e90b782156913642f01 /coin/provisioning/common/macos/increase_limits.sh
parentfbe3a8d84e943b8e1ff89389bc6af9e09532722a (diff)
Adjust pre-existing script to use the new common.sourced.sh
Change-Id: Icf7829d3499110a76b90679ba2d067f80d189e69 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
Diffstat (limited to 'coin/provisioning/common/macos/increase_limits.sh')
-rwxr-xr-xcoin/provisioning/common/macos/increase_limits.sh18
1 files changed, 8 insertions, 10 deletions
diff --git a/coin/provisioning/common/macos/increase_limits.sh b/coin/provisioning/common/macos/increase_limits.sh
index 666d9067..040c55e8 100755
--- a/coin/provisioning/common/macos/increase_limits.sh
+++ b/coin/provisioning/common/macos/increase_limits.sh
@@ -39,22 +39,20 @@
# and they sometimes create problems to the build process and telegraf.
-# Must have this variable set in the environment
-[ x"$PROVISION_DIR" = x ] && exit 38
+set -e
+
+PROVISIONING_DIR="$(dirname "$0")/../../"
+. "$PROVISIONING_DIR"/common/unix/common.sourced.sh
echo "Current limits are:"
ulimit -a
launchctl limit
-sudo cp $PROVISION_DIR/common/macos/limit.maxfiles.plist /Library/LaunchDaemons/
-sudo cp $PROVISION_DIR/common/macos/limit.maxproc.plist /Library/LaunchDaemons/
-
-sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
-sudo chown root:wheel /Library/LaunchDaemons/limit.maxproc.plist
-
-sudo chmod 644 /Library/LaunchDaemons/limit.maxfiles.plist
-sudo chmod 644 /Library/LaunchDaemons/limit.maxproc.plist
+$CMD_INSTALL -m 644 -o root -g wheel \
+ $PROVISIONING_DIR/common/macos/limit.maxfiles.plist \
+ $PROVISIONING_DIR/common/macos/limit.maxproc.plist \
+ /Library/LaunchDaemons/
# Activate the new limits immediately (not for the current session though)
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist