aboutsummaryrefslogtreecommitdiff
path: root/system/swapinzram/doinst.sh
diff options
context:
space:
mode:
authormarav <marav8@free.fr>2022-04-23 00:57:29 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-04-24 01:47:22 +0700
commit12351235e59bd24a4df8f82092d9e0234cfb2de7 (patch)
tree466496f0f3a4ad6dfbef27ab8480389035dfc2c1 /system/swapinzram/doinst.sh
parent5d6f5801863fc51cfc1a4847abad02893ab381b8 (diff)
system/swapinzram: Added (Configure a swap block device in RAM).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/swapinzram/doinst.sh')
-rw-r--r--system/swapinzram/doinst.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/system/swapinzram/doinst.sh b/system/swapinzram/doinst.sh
new file mode 100644
index 0000000000000..6856f514ad478
--- /dev/null
+++ b/system/swapinzram/doinst.sh
@@ -0,0 +1,15 @@
+#!/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