Skip to content

Instantly share code, notes, and snippets.

@dbinoj
Created February 26, 2016 17:56
Show Gist options
  • Save dbinoj/85e0fa6becf549f85b18 to your computer and use it in GitHub Desktop.
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
# --- /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