diff options
author | David Somero <dsomero@hotmail.com> | 2013-01-27 00:02:04 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2013-02-05 22:40:16 -0600 |
commit | 65a7c882475d7ab95283e85cf979a3b388ab4b6a (patch) | |
tree | fd16af32d34899f43041e43489bd60b34945941c /system/phpsysinfo/doinst.sh | |
parent | f932c75975bb0322da4f58172b079be04a583ae1 (diff) |
system/phpsysinfo: Added (displays system information)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/phpsysinfo/doinst.sh')
-rw-r--r-- | system/phpsysinfo/doinst.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/system/phpsysinfo/doinst.sh b/system/phpsysinfo/doinst.sh new file mode 100644 index 0000000000000..ef0828a41e6f9 --- /dev/null +++ b/system/phpsysinfo/doinst.sh @@ -0,0 +1,25 @@ +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 @PATH@ |