From ec0c7a74bbf5824adc4efa54e1f91984ac870a8e Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 6 May 2009 09:53:36 +0000 Subject: move to .in files --- setup-webconf.in | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 setup-webconf.in (limited to 'setup-webconf.in') diff --git a/setup-webconf.in b/setup-webconf.in new file mode 100644 index 0000000..9e11e99 --- /dev/null +++ b/setup-webconf.in @@ -0,0 +1,98 @@ +#!/bin/sh + +PROGRAM=setup-acf +VERSION=2.0_alpha7 + +PREFIX= +. $PREFIX/lib/libalpine.sh + +usage() { + echo "$PROGRAM [-adh] [-l address] [PACKAGE...]" + exit 0; +} + +pkgs="acf-core acf-alpine-baselayout acf-apk-tools" + +while getopts "adhl:" opt ; do + case $opt in + a) pkgs=`apk_fetch -l | grep ^acf-`;; + d) pkgs="$pkgs acf-devtools";; + h) usage;; + l) address="$OPTARG";; + *) usage;; + esac +done +shift `expr $OPTIND - 1` + +while [ $# -gt 0 ]; do + pkgs="$pkgs acf-$1" + shift +done + +# install packages +apk_add mini_httpd $pkgs || exit 1 + +# setup mini_httpd and start it +mkdir -p /var/www/localhost/ +ln -s /usr/share/acf/www/ /var/www/localhost/htdocs +lbu add /var/www/localhost/htdocs + + +SSLDIR=/etc/ssl/mini_httpd +SSLCNF=$SSLDIR/mini_httpd.cnf +KEYFILE=$SSLDIR/server.key +CRTFILE=$SSLDIR/server.crt +PEMFILE=$SSLDIR/server.pem + +if [ -f $PEMFILE ]; then + echo "$PEMFILE already exist." +else + mkdir -p $SSLDIR +cat >$SSLCNF < $KEYFILE + openssl req -new -x509 -nodes -sha1 -days 3650 -key $KEYFILE \ + -config $SSLCNF > $CRTFILE + cat $KEYFILE >> $CRTFILE + rm $KEYFILE + mv $CRTFILE $PEMFILE +fi + +cat >/etc/mini_httpd.conf <> /etc/mini_httpd.conf +fi + +cat >/etc/conf.d/mini_httpd </dev/null && /etc/init.d/mini_httpd stop +rc_add -k mini_httpd +/etc/init.d/mini_httpd start + -- cgit v1.2.3