summaryrefslogtreecommitdiffstats
path: root/system/swapinzram/doinst.sh
diff options
context:
space:
mode:
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 0000000000..6856f514ad
--- /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