0

SpoofDPI: add 0.12.0

This commit is contained in:
eleksir
2024-09-12 20:41:51 +03:00
parent 7a2a389f6c
commit 43128fc1e9
7 changed files with 239 additions and 0 deletions

26
SpoofDPI/doinst.sh Normal file
View File

@@ -0,0 +1,26 @@
config() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "$(cat $OLD|md5sum)" = "$(cat $NEW|md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
preserve_perms() {
NEW="$1"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
if [ -e $OLD ]; then
cp -a $OLD ${NEW}.incoming
cat $NEW > ${NEW}.incoming
mv ${NEW}.incoming $NEW
fi
config $NEW
}
config etc/default/spoofdpi.new
preserve_perms etc/rc.d/rc.spoofdpi.new