From d4b69f62452109ef309e4fb0e72c15938d2166f1 Mon Sep 17 00:00:00 2001 From: tianyu Date: Thu, 13 Nov 2014 14:13:22 +0800 Subject: [PATCH] add init script --- opensips/install.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/opensips/install.sh b/opensips/install.sh index a7ab970..cdc6dde 100644 --- a/opensips/install.sh +++ b/opensips/install.sh @@ -121,6 +121,17 @@ done if [ -d "/$ETCDIR/$BINNAME" ];then echo "/$ETCDIR/$BINNAME already exist, make backup." mv /$ETCDIR/$BINNAME /$ETCDIR/$BINNAME.backup-$(date +%F-%H-%M-%S) + echo "install $BINNAME.default to /$ETCDIR/default/$BINNAME..." + cp $ETCDIR/default/$BINNAME.default /$ETCDIR/default/$BINNAME + echo "install $BINNAME.init to /$ETCDIR/init.d/$BINNAME..." + cp $ETCDIR/init.d/$BINNAME.init /$ETCDIR/init.d/$BINNAME + chmod +x /$ETCDIR/init.d/$BINNAME + if [ -n $(command -v apt-get) ]; then + bash $ETCDIR/$BINNAME.postinst configure + elif [ -n $(command -v yum) ]; then + bash $ETCDIR/$BINNAME.postinst configure + passwd -l opensips + fi fi cp -r $ETCDIR/$BINNAME /$ETCDIR