-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.rc
61 lines (52 loc) · 1.55 KB
/
setup.rc
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Installer script for sysconf "actual" -*- shell-script -*-
. /usr/lib/sysconf.base/common.sh
# Install required Debian packages
_packages=
_packages="$_packages nginx"
_packages="$_packages php5-fpm php5-cli php5-pgsql php5-mcrypt php5-curl"
sysconf_require_packages $_packages
# Fix Nginx
_force_nginx_restart=no
if [ -r /etc/nginx/sites-enabled/default ]; then
rm -f /etc/nginx/sites-enabled/default
_force_nginx_restart=yes
fi
if ps x | grep nginx | grep -vq grep; then
if [ $_force_nginx_restart = yes ]; then
service nginx restart
fi
else
service nginx start
fi
# Fix php-fpm
_force_fpm_restart=no
if [ -r /etc/php5/fpm/pool.d/www.conf ]; then
rm -f /etc/php5/fpm/pool.d/www.conf
_force_fpm_restart=yes
fi
if ps x | grep php-fpm | grep -vq grep; then
if [ $_force_fpm_restart = yes ]; then
service php5-fpm restart
fi
else
service php5-fpm start
fi
# Install Tiny Tiny RSS
www_dir=/var/lib/tt-rss
url=https://github.com/gothfox/Tiny-Tiny-RSS/archive/1.15.3.tar.gz
if [ ! -f $www_dir/index.php ]; then
mkdir -p $www_dir
curl -L $url | tar xzv --strip-components=1 --directory $www_dir \
|| nef_fatal "could not download TinyTinyRSS archive: $url"
cd $www_dir
chown -R www-data:www-data .
fi
if [ ! -h /etc/rc3.d/*tt-rss ]; then
update-rc.d tt-rss defaults
fi
# (re)Start the service through /etc/init.d/tt-rss
if service tt-rss status >/dev/null; then
service tt-rss restart || nef_fatal "could not restart tt-rss"
else
service tt-rss start || nef_fatal "could not start tt-rss"
fi