summaryrefslogtreecommitdiff
path: root/system/openrc-services/doinst.sh
diff options
context:
space:
mode:
authorAaditya Bagga <aaditya_gnulinux@zoho.com>2015-05-29 21:54:50 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-05-31 10:36:21 +0700
commit6b4bead1d472c490c8ef595f8a6d09f4d6c47ed4 (patch)
tree2e59de4605e02dca052a93f12626fff49bbd5bcb /system/openrc-services/doinst.sh
parentbde21f861ff90f3f04323d140d244902cb9b520b (diff)
downloadslackbuilds-6b4bead1d472c490c8ef595f8a6d09f4d6c47ed4.tar.gz
system/openrc-services: Added (OpenRC services).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/openrc-services/doinst.sh')
-rw-r--r--system/openrc-services/doinst.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/system/openrc-services/doinst.sh b/system/openrc-services/doinst.sh
new file mode 100644
index 0000000000..816649e912
--- /dev/null
+++ b/system/openrc-services/doinst.sh
@@ -0,0 +1,38 @@
+
+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
+}
+
+openrc_base=(device-mapper dmcrypt lvm mdadm mdraid udev)
+openrc_desktop=(acpid alsasound xdm gpm rfcomm wpa_supplicant)
+openrc_devel=(git-daemon mysqld postgresql svn)
+openrc_misc=(bitlbee cpupower connman ntpd ntp-client sntp rsyslog saned metalog syslog-ng sensord lircd irexec haveged salt-master salt-minion salt-syncdic hdparm clamd boinc atd libvirtd)
+openrc_net=(named dhcpd dhcrelay dhcrelay6 iptables ip6tables rpcbind nfs nfsclient openntpd slapd sshd openvpn quota rsyncd samba saslauthd squid transmission-daemon ufw xinetd ypbind ypserv tor NetworkManager httpd syncthing)
+openrc_slack=(dcron sendmail sysklogd)
+openrc_video=(atieventsd vgl bumblebee)
+
+for file in "${openrc_base[@]}" "${openrc_desktop[@]}" "${openrc_devel[@]}" "${openrc_misc[@]}" "${openrc_net[@]}" "${openrc_slack[@]}" "${openrc_video[@]}"; do
+ config "etc/conf.d/${file}.new"
+done
+
+preserve_perms etc/local.d/rcM.start.new