#!/bin/bash
echo -e "/home/corefile/core-%e-%s-%u-%g-%p-%t" > /proc/sys/kernel/core_pattern
echo -e "1" > /proc/sys/kernel/core_uses_pid
grep "* hard core unlimited" /etc/security/limits.conf > /dev/null
if [ $? -ne 0 ]; then
echo "* hard core unlimited" >> /etc/security/limits.conf
fi
ulimit -S -c unlimited
if [ ! -d "/home/corefile" ]; then
cd /home && mkdir corefile && chmod 777 corefile
fi
echo -e "/home/corefile/core-%e-%s-%u-%g-%p-%t" > /proc/sys/kernel/core_pattern
echo -e "1" > /proc/sys/kernel/core_uses_pid
grep "* hard core unlimited" /etc/security/limits.conf > /dev/null
if [ $? -ne 0 ]; then
echo "* hard core unlimited" >> /etc/security/limits.conf
fi
ulimit -S -c unlimited
if [ ! -d "/home/corefile" ]; then
cd /home && mkdir corefile && chmod 777 corefile
fi