Created
February 26, 2016 17:56
-
-
Save dbinoj/85e0fa6becf549f85b18 to your computer and use it in GitHub Desktop.
Function to check if network drive is mounted before starting syslog-ng Raw
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
# --- /etc/init.d/syslog-ng | |
# --- For use at manual start of syslog-ng only. | |
# --- Do not use this mod if syslog-ng is "on" at any runlevel. (check with 'chkconfig --list syslog-ng') | |
check_storage() | |
{ | |
while : | |
do | |
if mount | grep "/dev/sdb1 on /var/logs type ext4" | grep "rw" > /dev/null; then | |
echo "/dev/sdb1 is ready..." | |
break | |
else | |
echo "Waiting for /dev/sdb1 to be ready..." | |
sleep 2 | |
fi | |
done | |
return 0 | |
} | |
start() | |
{ | |
check_storage | |
verify_config | |
# ---- rest of the start script | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment