From 98c52dfb5c6cf4acdcf26b8715f619c014cc2c38 Mon Sep 17 00:00:00 2001 From: "Thales A. Tsailas" Date: Tue, 11 May 2010 22:54:50 +0200 Subject: network/iscsitarget: Added to 12.1 repository --- network/iscsitarget/doinst.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 network/iscsitarget/doinst.sh (limited to 'network/iscsitarget/doinst.sh') diff --git a/network/iscsitarget/doinst.sh b/network/iscsitarget/doinst.sh new file mode 100644 index 0000000000000..89debfb1e38c0 --- /dev/null +++ b/network/iscsitarget/doinst.sh @@ -0,0 +1,30 @@ +#!/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.iscsi-target.new: +if [ -e etc/rc.d/rc.iscsi-target ]; then + cp -a etc/rc.d/rc.iscsi-target etc/rc.d/rc.iscsi-target.new.incoming + cat etc/rc.d/rc.iscsi-target.new > etc/rc.d/rc.iscsi-target.new.incoming + mv etc/rc.d/rc.iscsi-target.new.incoming etc/rc.d/rc.iscsi-target.new +else + # Install executable otherwise - irrelevant unless user starts in rc.local + chmod 0755 etc/rc.d/rc.iscsi-target.new +fi + +config etc/rc.d/rc.iscsi-target.new + +if [ -x /sbin/depmod ]; then +echo -e "Updating modules..." +depmod -a +fi -- cgit v1.2.3