File tree Expand file tree Collapse file tree 4 files changed +19
-20
lines changed
Expand file tree Collapse file tree 4 files changed +19
-20
lines changed Original file line number Diff line number Diff line change 2323 ./update.sh || exit $?
2424
2525 cd " $TMPDIR "
26- git describe --always --tags --abbrev=0 2> /dev/null | grep -oP " v\d+\.\d+\.\d+" || git fetch --unshallow --tags
26+ git describe --always --tags --abbrev=0 2> /dev/null | grep -qoP " v\d+\.\d+\.\d+" || git fetch --unshallow --tags
2727 VER=$( git describe --always --tags --abbrev=0 | grep -oP " v\d+\.\d+\.\d+" )
2828
2929 # check format
Original file line number Diff line number Diff line change @@ -13,13 +13,12 @@ configure()
1313{
1414 [[ -d " $DIR " ]] || { echo " directory $DIR does not exist" ; return 1; }
1515
16- local destfile=" $DIR " /ncp-config_$( date +" %Y%m%d" ) .tar
16+ local destfile
17+ destfile=" $DIR " /ncp-config_$( date +" %Y%m%d" ) .tar
1718
1819 tar -cf " $destfile " -C /usr/local/etc/ncp-config.d .
1920 chmod 600 " $destfile "
2021
21- cd $OLDPWD
22- rm -rf /tmp/ncp-export
2322 echo -e " configuration exported to $destfile "
2423}
2524
Original file line number Diff line number Diff line change 99
1010
1111
12- CFGDIR=" /usr/local/etc/ncp-config.d"
1312
1413configure ()
1514{
1615 [[ -f " $FILE " ]] || { echo " export file $FILE does not exist" ; return 1; }
1716
18- source /usr/local/etc/library.sh || return 1
1917 cd " $CFGDIR " || return 1
2018
2119 # extract export
2220 tar -xf " $FILE " -C " $CFGDIR "
2321
24- # UGLY workaround to prevent apache from restarting upon activating some extras
25- # which leads to the operation appearing to fail in ncp-web
26- # echo "invalid_op" >> /etc/apache2/sites-available/000-default.conf
22+ # activate ncp-apps
23+ find " ${CFGDIR} /" -name ' *.cfg' | while read -r cfg; do
24+ app=" $( basename " ${cfg} " .cfg) "
25+ if [[ " ${app} " == " letsencrypt" ]] || [[ " ${app} " == " dnsmasq" ]]; then
26+ continue
27+ fi
28+ is_active_app " ${app} " && run_app " ${app} "
29+ done
2730
28- # activate
29- # TODO
30-
31- # Fix invalid configuration
32- # sed -i "/^invalid_op/d" /etc/apache2/sites-available/000-default.conf
31+ # order is important for these
32+ is_active_app " dnsmasq" && run_app " dnsmasq"
33+ is_active_app " letsencrypt" && run_app " letsencrypt"
3334
3435 echo -e " \nconfiguration restored"
3536
3637 # delayed in bg so it does not kill the connection, and we get AJAX response
37- bash -c " sleep 2 && service apache2 reload " & > /dev/null &
38+ apachectl -k graceful
3839}
3940
4041install () { : ; }
Original file line number Diff line number Diff line change 88# More at ownyourbits.com
99#
1010
11- NCDIR=/var/www/nextcloud/
12- NCPWB=/var/www/ncp-web/
13-
1411install ()
1512{
1613 apt-get update
4239
4340configure ()
4441{
42+ local NCDIR=/var/www/nextcloud/
43+ local NCPWB=/var/www/ncp-web/
44+
4545 cat > /etc/modsecurity/modsecurity_crs_99_whitelist.conf << EOF
4646<Directory $NCDIR >
4747 # VIDEOS
9292 [[ $ACTIVE == " yes" ]] && echo " Enabling module security2" || echo " Disabling module security2"
9393 [[ $ACTIVE == " yes" ]] && a2enmod security2 & > /dev/null || a2dismod security2 & > /dev/null
9494
95- # delayed in bg so it does not kill the connection, and we get AJAX response
96- bash -c " sleep 2 && service apache2 reload" & > /dev/null &
95+ apachectl -k graceful
9796}
9897
9998# License
You can’t perform that action at this time.
0 commit comments