build: fix cleanup armbian images

This commit is contained in:
nachoparker 2018-05-29 18:56:56 +02:00
parent 6d1cd56883
commit 3862eca0ed
7 changed files with 14 additions and 12 deletions

View File

@ -26,8 +26,8 @@ source buildlib.sh # initializes $IMGNAME
# Armbian
./build-SD-armbian.sh odroidxu4 OdroidHC2
./build-SD-armbian.sh rock64
./build-SD-armbian.sh bananapi
./build-SD-armbian.sh rock64 Rock64
./build-SD-armbian.sh bananapi Bananapi
# Docker x86
docker pull debian:stretch-slim

View File

@ -11,7 +11,7 @@
set -e
source buildlib.sh
IP=${1:-192.168.0.145} # For QEMU automated testing
IP=${1:-192.168.0.145} # For QEMU automated testing (optional)
SIZE=3G # Raspbian image size
#CLEAN=1 # Pass this envvar to clean download cache
IMG="NextCloudPi_RPi_$( date "+%m-%d-%y" ).img"

View File

@ -94,6 +94,7 @@ ExecStart=/bin/bash /usr/local/bin/ncp-provisioning.sh
[Install]
WantedBy=multi-user.target
EOF
systemctl enable nc-provisioning
return 0
}

View File

@ -29,7 +29,6 @@ grep -q -e "Debian GNU/Linux 9" -e "Raspbian GNU/Linux 9" /etc/issue || {
}
# check installed software
type apache2 &>/dev/null && APACHE_EXISTS=1
type mysqld &>/dev/null && echo ">>> WARNING: existing mysqld configuration will be changed <<<"
# get install code
@ -52,10 +51,7 @@ install_script etc/ncp-config.d/nc-nextcloud.sh
activate_script etc/ncp-config.d/nc-nextcloud.sh
install_script ncp.sh
activate_script etc/ncp-config.d/nc-init.sh
# re-enable mods disabled during install, in case there's other shared services in apache2
[[ "$APACHE_EXISTS" != "" ]] && \
a2enmod status reqtimeout env autoindex access_compat auth_basic authn_file authn_core alias access_compat
[[ -f /.ncp-image ]] && activate_script post-inst.sh
popd
echo "Done.

View File

@ -106,7 +106,6 @@ EOF
a2enmod mime
a2enmod ssl
a2dismod -f status reqtimeout env autoindex access_compat auth_basic authn_file authn_core alias access_compat
echo "ServerName localhost" >> /etc/apache2/apache2.conf

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Cleanup step Raspbian image
# Cleanup step NCP image
#
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
# GPL licensed (see end of file) * Use at your own risk!
@ -15,8 +15,8 @@ configure()
kill $( cat /run/redis/redis-server.pid )
kill $( cat /run/crond.pid )
# enable randomize passwords
systemctl enable nc-provisioning
# disable unused apache mods
a2dismod status reqtimeout env autoindex access_compat auth_basic authn_file authn_core alias access_compat
# cleanup all NCP extras
source /usr/local/etc/library.sh

View File

@ -232,6 +232,12 @@ done
sed -i 's|NextCloudPlus autogenerated|NextCloudPi autogenerated|' /etc/dhcpcd.conf
sed -i 's|NextCloudPlus|NextCloudPi|' /etc/fail2ban/action.d/sendmail-whois-lines.conf
# make sure provisioning is enabled
systemctl -q is-enabled nc-provisioning || {
systemctl start nc-provisioning
systemctl enable nc-provisioning
}
} # end - only live updates
exit 0