summaryrefslogtreecommitdiff
path: root/system/cndrvcups-capt/doinst.sh
diff options
context:
space:
mode:
authorMario Preksavec <mario@slackware.hr>2014-11-02 12:06:37 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2014-11-02 12:12:35 +0700
commit3df6142fda67ba5b027ef2539c714c749991b3b2 (patch)
tree47c205008ec332edae64cee5741aa48252003e57 /system/cndrvcups-capt/doinst.sh
parentf44ae903b13fdc7904a0d9fb85ae5b1579e34239 (diff)
downloadslackbuilds-3df6142fda67ba5b027ef2539c714c749991b3b2.tar.gz
system/cndrvcups-capt: Added (Canon CAPT Printer Driver).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/cndrvcups-capt/doinst.sh')
-rw-r--r--system/cndrvcups-capt/doinst.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/system/cndrvcups-capt/doinst.sh b/system/cndrvcups-capt/doinst.sh
new file mode 100644
index 0000000000..00d59401e1
--- /dev/null
+++ b/system/cndrvcups-capt/doinst.sh
@@ -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
+}
+
+preserve_perms etc/rc.d/rc.ccpd.new
+config etc/ccpd.conf.new