mirror of https://github.com/azlux/log2ram.git
Update install.sh
Add a check for the size of /var/log and show a warning it it is too small
This commit is contained in:
parent
8e1a0e4418
commit
099899a553
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
[ "$(id -u)" -eq 0 ] || { echo 'You need to be ROOT (sudo can be used)' ; exit 1 ;}
|
[ "$(id -u)" -eq 0 ] || { echo 'You need to be ROOT (sudo can be used)' ; exit 1 ;}
|
||||||
|
|
||||||
|
. /log2ram.conf # Include config to check if size is enought (See below)
|
||||||
|
|
||||||
# See if we can find out the init-system
|
# See if we can find out the init-system
|
||||||
echo 'Try to detect init and running log2ram service...'
|
echo 'Try to detect init and running log2ram service...'
|
||||||
if [ "$(systemctl --version 2> /dev/null)" != '' ] ; then
|
if [ "$(systemctl --version 2> /dev/null)" != '' ] ; then
|
||||||
|
@ -47,5 +49,11 @@ rm -rf /var/log.hdd
|
||||||
# Make sure we start clean
|
# Make sure we start clean
|
||||||
rm -rf /var/hdd.log
|
rm -rf /var/hdd.log
|
||||||
|
|
||||||
|
# Check if var SIZE is sufficient and show a warning when too small
|
||||||
|
if [ -n "$(du -sh -t "$SIZE" /var/log | cut -f1)" ] ; then # /var/log should be ok on all systems
|
||||||
|
echo 'WARNING: Variable SIZE in /etc/log2ram.conf is too small to store the /var/log!'
|
||||||
|
echo 'Actual size of /var/log is:' ; du -sh /var/log
|
||||||
|
fi
|
||||||
|
|
||||||
echo '##### Reboot to activate log2ram! #####'
|
echo '##### Reboot to activate log2ram! #####'
|
||||||
echo '##### Edit /etc/log2ram.conf to configure options #####'
|
echo '##### Edit /etc/log2ram.conf to configure options #####'
|
||||||
|
|
Loading…
Reference in New Issue