forked from bobrathbone/piradio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
radioweb.postinst
29 lines (23 loc) · 701 Bytes
/
radioweb.postinst
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
27
28
29
#!/bin/bash
# Radio daemon post install script
# $Id: radioweb.postinst,v 1.4 2016/01/25 15:17:15 bob Exp $
# File locations
DIR=/usr/share/radio
TARFILE=${DIR}/piradio_web.tar.gz
SNOOPY=/var/www/html/snoopy
APACHE_CONFIG=/etc/apache2
CGILOAD=cgi.load
if [[ -d ${SNOOPY} ]]; then
echo "The web pages appear to be already installed"
echo "Updating web pages and CGI scripts in Apache"
else
echo "Installing web pages and CGI scripts in Apache"
fi
# Change to root
cd /
sudo tar -xvf ${TARFILE} > /dev/null
# Enable cgi scripts
ln -s ${APACHE_CONFIG}/mods-available/${CGILOAD} ${APACHE_CONFIG}/mods-enabled/${CGILOAD}
# Restart web server
apachectl restart
# End of post-installation script