Last active
August 29, 2015 14:23
-
-
Save piraces/4a030b6777e4da942c98 to your computer and use it in GitHub Desktop.
Fix dropbox problem with max_user_watches (compatible with several linux distros).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Autor: Raul Piraces. | |
# This script requires "sudo" to be installed. | |
# Fix dropbox problem with max_user_watches. | |
# Working on several linux distros (based on ArchLinux, Debian, Ubuntu, Fedora, CentOS, etc.). | |
FILE="/usr/lib/sysctl.d/50-default.conf" | |
FILE2="/etc/sysctl.conf" | |
if [ -f $FILE ]; | |
then | |
echo "[X] Aplicando solucion 1..." | |
echo "fs.inotify.max_user_watches = 100000" | sudo tee --append $FILE | |
echo "[X] Solucion 1 aplicada" | |
sudo systemctl restart dropbox.service | |
echo "Reinicie dropbox manualmente para finalizar (puede no haberse reiniciado automáticamente)." | |
else | |
echo "Solucion 1 no compatible" | |
echo "Aplicando solucion 2..." | |
echo "fs.inotify.max_user_watches = 100000" | sudo tee --append $FILE2 | |
sudo sysctl --system | |
sudo sysctl -p | |
echo "[X] Solucion 2 aplicada" | |
echo "Reiniciando dropbox..." | |
sudo service dropbox restart | |
sudo systemctl restart dropbox.service | |
echo "Completado, si ha surgido un fallo al reiniciar el servicio, tratelo de reiniciar manualmente." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment