summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-05-05 22:49:55 +0000
committerRussell Bryant <russell@russellbryant.com>2006-05-05 22:49:55 +0000
commit272de2c3942846bfec84f67344862594b59af5f5 (patch)
treeebf2812ecab2baf36ad7990632463544290bfaad /Makefile
parent085a4eaa0438b2d5b7a48b88313fbbdfb52b8851 (diff)
add support for installing other init scripts, other than just the redhat
version. (issue #7093, initial patch by froguz, extended by north) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@25095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 24 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 667c0e1e7..98a669ed3 100644
--- a/Makefile
+++ b/Makefile
@@ -884,12 +884,30 @@ mpg123:
$(MAKE) -C mpg123-0.59r $(MPG123TARG)
config:
- if [ -d /etc/rc.d/init.d ]; then \
- $(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
- /sbin/chkconfig --add asterisk; \
- elif [ -d /etc/init.d ]; then \
- $(INSTALL) -m 755 init.asterisk /etc/init.d/asterisk; \
- fi
+ @if [ "${OSARCH}" = "Linux" ]; then \
+ if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
+ $(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
+ /sbin/chkconfig --add asterisk; \
+ elif [ -f /etc/debian_version ]; then \
+ $(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk /etc/init.d/asterisk; \
+ /usr/sbin/update-rc.d asterisk start 10 2 3 4 5 . stop 91 2 3 4 5 .; \
+ elif [ -f /etc/gentoo-release ]; then \
+ $(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk /etc/init.d/asterisk; \
+ /sbin/rc-update add asterisk default; \
+ elif [ -f /etc/mandrake-release ]; then \
+ $(INSTALL) -m 755 contrib/init.d/rc.mandrake.asterisk /etc/rc.d/init.d/asterisk; \
+ /sbin/chkconfig --add asterisk; \
+ elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
+ $(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk /etc/init.d/asterisk; \
+ /sbin/chkconfig --add asterisk; \
+ elif [ -f /etc/slackware-version ]; then \
+ echo "Slackware is not currently supported, although an init script does exist for it." \
+ else \
+ echo "We could not install init scripts for your distribution."; \
+ fi \
+ else \
+ echo "We could not install init scripts for your operating system."; \
+ fi
dont-optimize: _all