diff options
author | Alan Hicks <alan@lizella.net> | 2010-05-11 20:01:10 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-11 20:01:10 +0200 |
commit | bfa15f6fd3fe9670e5e0600f181c5a792c9d5443 (patch) | |
tree | 051f3a90da93baef409f47f61b5dfeefc85b273d /misc/zaptel/doinst.sh | |
parent | aeaff03f0e132d1b3d97f68ec5e79d130c932170 (diff) | |
download | slackbuilds-bfa15f6fd3fe9670e5e0600f181c5a792c9d5443.tar.gz |
misc/zaptel: Added to 12.0 repository
Diffstat (limited to 'misc/zaptel/doinst.sh')
-rw-r--r-- | misc/zaptel/doinst.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/misc/zaptel/doinst.sh b/misc/zaptel/doinst.sh new file mode 100644 index 0000000000..c3cebabe6b --- /dev/null +++ b/misc/zaptel/doinst.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +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... +} + +# Keep same perms on rc.zaptel.new: +if [ -e etc/rc.d/rc.zaptel ]; then + cp -a etc/rc.d/rc.zaptel etc/rc.d/rc.zaptel.new.incoming + cat etc/rc.d/rc.zaptel.new > etc/rc.d/rc.zaptel.new.incoming + mv etc/rc.d/rc.zaptel.new.incoming etc/rc.d/rc.zaptel.new +fi + +config etc/rc.d/rc.zaptel.new +config etc/zaptel.conf.new + +# Since we're creating kernel modules, this is necessary +chroot . depmod -a 2>/dev/null + |