status-react/scripts/inotify_fix.sh
Jakub Sokołowski 46bd2b2e4c
cleanup of shell scripts
Changes:
- Add missing lazy assignment for OS_NAME, fixes double Nix shells
- Moved `scripts/add-nix-gcroots.sh` to `nix/scripts/gcroots.sh`
- Moved Nix package manager setup to `nix/scripts/setup.sh`
- Created `nix/scripts/source.sh` to reuse in all Nix scripts
- Created `STARTING_GUIDE.md` with instructions for contributors
- Created `scripts/colors.sh` for definition of shell colors
- Removed `scripts/setup` in favor of `nix/scripts/setup.sh`
- Removed all of `scripts/lib` since it was useless

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-02-24 19:31:55 +01:00

23 lines
700 B
Bash
Executable File

#!/usr/bin/env bash
# If this is not run on some machines react-native builds fail.
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
source "${GIT_ROOT}/scripts/colors.sh"
if [[ "$(uname -s)" != Linux ]]; then
echo "inotify fix not applicable on non-linux OS"
exit
fi
watches=$(cat /proc/sys/fs/inotify/max_user_watches)
required_watches=524288
if [ $watches -lt $required_watches ]; then
echo -e "${YLW}fs.inotify.max_user_watches limit is too low ($watches). Increasing it.${RST}"
echo "fs.inotify.max_user_watches = $required_watches" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
else
echo -e "${GRN}fs.inotify.max_user_watches limit is high enough.${RST}"
fi