diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-12-05 14:35:25 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-12-05 14:35:25 +0300 |
commit | 89f77e7e02b95534972fdb4eb0af2e7e6af3ecb5 (patch) | |
tree | 64085d160c1e0d4ab6f2c37059ea112a25407919 | |
parent | 30c34d8162f48c976b896141586174e916378369 (diff) |
build: cleanup all extras
-rw-r--r-- | armbian.sh | 7 | ||||
-rw-r--r-- | docker-armhf/nextcloudpi/Dockerfile | 38 | ||||
-rwxr-xr-x | etc/library.sh | 14 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/letsencrypt.sh | 37 | ||||
-rw-r--r-- | raspbian-cleanup.sh | 7 |
5 files changed, 69 insertions, 34 deletions
@@ -49,6 +49,13 @@ Main() { rm /var/lib/apt/lists/* -r rm /.ncp-image + # cleanup all NCP options + source /usr/local/etc/library.sh + cd /usr/local/etc/nextcloudpi-config.d/ + for script in *.sh; do + cleanup_script $script + done + ;; esac } # Main diff --git a/docker-armhf/nextcloudpi/Dockerfile b/docker-armhf/nextcloudpi/Dockerfile index f62ceec5..c3b58663 100644 --- a/docker-armhf/nextcloudpi/Dockerfile +++ b/docker-armhf/nextcloudpi/Dockerfile @@ -31,40 +31,10 @@ rm /.ncp-image; \ # remove wizard for now rm -r /var/www/ncp-web/wizard; \ -# letsencrypt build artifacts cleanup -apt-get purge -y \ - make \ - git \ - augeas-lenses \ - binutils \ - cpp \ - cpp-6 \ - gcc \ - gcc-6 \ - libasan3 \ - libaugeas0 \ - libc-dev-bin \ - libc6-dev \ - libcc1-0 \ - libexpat1-dev \ - libffi-dev \ - libgcc-6-dev \ - libgomp1 \ - libisl15 \ - libmpc3 \ - libpython-dev \ - libpython2.7-dev \ - libssl-dev \ - libubsan0 \ - linux-libc-dev \ - python-dev \ - python-virtualenv \ - python2.7-dev \ - python-pkg-resources \ - python3-pkg-resources \ - python3-virtualenv \ - virtualenv \ - python-pip-whl; \ +# cleanup all NCP extras +source /usr/local/etc/library.sh; \ +cd /usr/local/etc/nextcloudpi-config.d/; \ +for script in *.sh; do cleanup_script $script done; \ # package clean up apt-get autoremove -y; \ diff --git a/etc/library.sh b/etc/library.sh index a577c2f1..06e19650 100755 --- a/etc/library.sh +++ b/etc/library.sh @@ -144,6 +144,20 @@ function configure_script() ) } +function cleanup_script() +{ + ( + local SCRIPT=$1 + cd /usr/local/etc/nextcloudpi-config.d/ || return 1 + unset cleanup + source ./"$SCRIPT" + [[ $( type -t cleanup ) == function ]] && { + cleanup + return $? + } + ) +} + function persistent_cfg() { local SRC="$1" diff --git a/etc/nextcloudpi-config.d/letsencrypt.sh b/etc/nextcloudpi-config.d/letsencrypt.sh index 0c7d3fa7..7fcd0697 100644 --- a/etc/nextcloudpi-config.d/letsencrypt.sh +++ b/etc/nextcloudpi-config.d/letsencrypt.sh @@ -86,6 +86,43 @@ configure() return 1 } +cleanup() +{ + apt-get purge -y \ + make \ + git \ + augeas-lenses \ + binutils \ + cpp \ + cpp-6 \ + gcc \ + gcc-6 \ + libasan3 \ + libaugeas0 \ + libc-dev-bin \ + libc6-dev \ + libcc1-0 \ + libexpat1-dev \ + libffi-dev \ + libgcc-6-dev \ + libgomp1 \ + libisl15 \ + libmpc3 \ + libpython-dev \ + libpython2.7-dev \ + libssl-dev \ + libubsan0 \ + linux-libc-dev \ + python-dev \ + python-virtualenv \ + python2.7-dev \ + python-pkg-resources \ + python3-pkg-resources \ + python3-virtualenv \ + virtualenv \ + python-pip-whl +} + # License # # This script is free software; you can redistribute it and/or modify it diff --git a/raspbian-cleanup.sh b/raspbian-cleanup.sh index 77a66247..c030f8a4 100644 --- a/raspbian-cleanup.sh +++ b/raspbian-cleanup.sh @@ -19,6 +19,13 @@ configure() { :; } cleanup() { + # cleanup all NCP extras + source /usr/local/etc/library.sh + cd /usr/local/etc/nextcloudpi-config.d/ + for script in *.sh; do + cleanup_script $script + done + # clean packages apt-get autoremove -y apt-get clean |