diff options
author | Richard Mortier <mort@cantab.net> | 2019-09-13 14:19:10 +0100 |
---|---|---|
committer | Richard Mortier <mort@cantab.net> | 2019-09-13 14:19:10 +0100 |
commit | eed1a4d608fdb061a9f3e9d06bc10dfc3db6d8c9 (patch) | |
tree | d02bc204401a69d981c65fe4aac003c6f466fda2 | |
parent | 55dbf2a7257bc0d7c44b37e98e26036c9032eb39 (diff) | |
download | docker-abuild-eed1a4d608fdb061a9f3e9d06bc10dfc3db6d8c9.tar.bz2 docker-abuild-eed1a4d608fdb061a9f3e9d06bc10dfc3db6d8c9.tar.xz |
entrypoint: test if `~/.abuild` writable, fail if not
Signed-off-by: Richard Mortier <mort@cantab.net>
-rwxr-xr-x | entrypoint.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/entrypoint.sh b/entrypoint.sh index 9aa1adb..c9dfc55 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,12 +2,22 @@ set -e +die () { + printf >&2 "%s\n" "$@" + exit 1 +} + ## debug if [ "$DABUILD_DEBUG" = "true" ]; then set -x PS4='$LINENO: ' fi +## check can write to ~/.abuild +if [ ! -w "$HOME/.abuild/" ]; then + die "Error: unwritable ~/.abuild [$(ls -lad ~/.abuild | cut -d " " -f 1)]" +fi + ## generate signing keys on first run if [ ! -r "$HOME/.abuild/abuild.conf" ]; then abuild-keygen -n -a |