Avoid duplicates

This commit is contained in:
Bob Mottram 2014-09-23 13:39:49 +01:00
parent 8432148dcf
commit 7aa75691a7
1 changed files with 3 additions and 1 deletions

View File

@ -194,7 +194,9 @@ function enable_zram {
if grep -Fxq "enable_zram" $COMPLETION_FILE; then
return
fi
echo "options zram num_devices=1" >> /etc/modprobe.d/zram.conf
if ! grep -q "options zram num_devices=1" /etc/modprobe.d/zram.conf; then
echo 'options zram num_devices=1' >> /etc/modprobe.d/zram.conf
fi
echo '#!/bin/bash' > /etc/init.d/zram
echo '### BEGIN INIT INFO' >> /etc/init.d/zram
echo '# Provides: zram' >> /etc/init.d/zram