diff options
author | Dubiousjim <dubiousjim@gmail.com> | 2013-07-05 00:21:39 -0400 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-07-09 07:13:46 +0000 |
commit | cfa6c7d67ab934dfe1dd083f11f2ce4dcc400afc (patch) | |
tree | f0d6a0c1af2e1e8b0286b0435c5dcdc7958950ac /abuild-keygen.in | |
parent | 89afa4179287af307e298f6027dc4eee44bcf481 (diff) | |
download | abuild-cfa6c7d67ab934dfe1dd083f11f2ce4dcc400afc.tar.gz abuild-cfa6c7d67ab934dfe1dd083f11f2ce4dcc400afc.tar.bz2 abuild-cfa6c7d67ab934dfe1dd083f11f2ce4dcc400afc.tar.xz abuild-cfa6c7d67ab934dfe1dd083f11f2ce4dcc400afc.zip |
various: fancier readconfig, permit env overrides
Diffstat (limited to 'abuild-keygen.in')
-rw-r--r-- | abuild-keygen.in | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/abuild-keygen.in b/abuild-keygen.in index dbedad1..c02ad82 100644 --- a/abuild-keygen.in +++ b/abuild-keygen.in @@ -30,7 +30,7 @@ get_privkey_file() { default_name="${emailaddr:-$USER}-$(printf "%x" $(date +%s))" - privkey="$abuild_home/$default_name.rsa" + privkey="$ABUILD_USERDIR/$default_name.rsa" [ -n "$non_interactive" ] && return 0 msg "Generating public/private rsa key pair for abuild" echo -n "Enter file in which to save the key [$privkey]: " @@ -42,7 +42,7 @@ get_privkey_file() { } do_keygen() { - mkdir -p "$abuild_home" + mkdir -p "$ABUILD_USERDIR" get_privkey_file pubkey="$privkey.pub" @@ -68,14 +68,14 @@ do_keygen() { fi if [ -n "$append_config" ]; then - if [ -f "$abuild_userconf" ]; then + if [ -f "$ABUILD_USERCONF" ]; then # comment out the existing values - sed -i -e 's/^PACKAGER_PRIVKEY=/\#&/' "$abuild_userconf" + sed -i -e 's/^PACKAGER_PRIVKEY=/\#&/' "$ABUILD_USERCONF" fi - echo "PACKAGER_PRIVKEY=\"$privkey\"" >> "$abuild_userconf" + echo "PACKAGER_PRIVKEY=\"$privkey\"" >> "$ABUILD_USERCONF" else msg "" - msg "You might want add following line to $abuild_userconf:" + msg "You might want add following line to $ABUILD_USERCONF:" msg "" msg "PACKAGER_PRIVKEY=\"$privkey\"" msg "" @@ -92,7 +92,7 @@ usage() { $prog $abuild_ver - generate signing keys Usage: $prog [-a|--append] [-i|--install] [-n] Options: - -a, --append Set PACKAGER_PRIVKEY=<generated key> in $abuild_userconf + -a, --append Set PACKAGER_PRIVKEY=<generated key> in $ABUILD_USERCONF -i, --install Install public key into /etc/apk/keys using sudo -n Non-interactive. Use defaults -q, --quiet |