-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostinstall-web.sh
26 lines (26 loc) · 1.03 KB
/
postinstall-web.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
REPO="$(/sbin/uci -qc /opt/bolemo/etc/config get aegis.repo)"
[ -z "$REPO" ] && REPO='stable'
GIT_DIR="https://raw.githubusercontent.com/bolemo/aegis/$REPO"
DAT_DIR='/opt/bolemo/www/aegis_data'
[ -d $DAT_DIR ] || /bin/mkdir $DAT_DIR
_getMDFile() {
/bin/rm -f "$DAT_DIR/$1.htm"
/usr/bin/wget -qO- --no-check-certificate "$GIT_DIR/$1.md" | /usr/bin/curl -sS -X POST --data-binary @- https://api.github.com/markdown/raw --header "Content-Type:text/x-markdown" >"$DAT_DIR/$1.htm"
}
_getMDFile 'README'
_getMDFile 'CHANGELOG'
_getMDFile 'LINKS'
_getMDFile 'WEB.README'
LHTTPD_CONF='/etc/lighttpd/conf.d'
LHTTPD_WC_CONF="$LHTTPD_CONF/31-aegis.conf"
if test -d "$LHTTPD_CONF" && ! test -e "$LHTTPD_WC_CONF"; then
cat >/opt/bolemo/etc/lighttpd_aegis_web.conf <<'EOF'
$HTTP["url"] =~ "/bolemo/" {
cgi.assign = ( "aegis_web.cgi" => "/opt/bolemo/www/cgi-bin/aegis_web.cgi" )
}
EOF
/bin/ln -sfn /opt/bolemo/etc/lighttpd_aegis_web.conf "$LHTTPD_WC_CONF"
/etc/init.d/lighttpd restart
fi
echo '- Web Companion post install: done!'