diff options
author | Aaditya Bagga <aaditya_gnulinux@zoho.com> | 2015-05-29 21:42:54 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2015-05-31 10:36:20 +0700 |
commit | bde21f861ff90f3f04323d140d244902cb9b520b (patch) | |
tree | 11a5948a47a3d8a2862e42c28908a8e7213565d7 /system/openrc/doinst.sh | |
parent | e2703d9ce1ebcf3aabac1a7f3236371b50a0b3cf (diff) | |
download | slackbuilds-bde21f861ff90f3f04323d140d244902cb9b520b.tar.gz |
system/openrc: Added (dependency-based init system).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/openrc/doinst.sh')
-rw-r--r-- | system/openrc/doinst.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/system/openrc/doinst.sh b/system/openrc/doinst.sh new file mode 100644 index 0000000000..b2fca4b27e --- /dev/null +++ b/system/openrc/doinst.sh @@ -0,0 +1,24 @@ + +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... +} + +BACKUP=(etc/inittab + etc/rc.conf + etc/conf.d/{bootmisc,consolefont,devfs,dmesg,fsck,hostname,hwclock,keymaps} + etc/conf.d/{killprocs,localmount,modules,netmount,network,staticroute} + etc/conf.d/{tmpfiles,urandom} + etc/logrotate.d/openrc) +for file in "${BACKUP[@]}"; do + config ${file}.new +done + |