slackbuilds_ponce/system/swapinzram/doinst.sh
marav 12351235e5
system/swapinzram: Added (Configure a swap block device in RAM).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-04-24 01:47:22 +07:00

15 lines
277 B
Bash

#!/bin/sh
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
rm $NEW
fi
}
config etc/swapinzram.conf.new
config etc/sysctl.d/10-zram.conf.new