Skip to content

Commit

Permalink
Default location changed to /etc/apt/keyrings
Browse files Browse the repository at this point in the history
  • Loading branch information
ameinild committed Jul 8, 2022
1 parent 1661391 commit 1037895
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ This script supports up to 2 arguments:
- Empty - output path is set in config, filename is taken from existing key

This script has a config file `/usr/local/etc/add-apt-key.conf`, where the following variables can be set:
- `keypath` : path to store converted key - default is `/usr/share/keyrings`
- `keypath` : path to store converted key - default is `/etc/apt/keyrings`
- `verbosity` : if set to Yes - displays extra output
- `removetmp` : if set to Yes - remove input (non-converted) file

Example 1: (`PWD=/root`)

sudo add-apt-key https://mariadb.org/mariadb_release_signing_key.asc /usr/local/share/keyrings/
sudo add-apt-key https://mariadb.org/mariadb_release_signing_key.asc /usr/share/keyrings/

Will download key in `/root`, convert it and store as `/usr/local/share/keyrings/mariadb_release_signing_key.gpg`
Will download key in `/root`, convert it and store as `/usr/share/keyrings/mariadb_release_signing_key.gpg`

Example 2: (`PWD=/home/user`)

sudo add-apt-key /root/mariadb_release_signing_key.asc /usr/local/share/keyrings/mariadbkey
sudo add-apt-key /root/mariadb_release_signing_key.asc /usr/share/keyrings/mariadbkey

Will use existing key in `/root`, convert it and store as `/usr/local/share/keyrings/mariadbkey.gpg`
Will use existing key in `/root`, convert it and store as `/usr/share/keyrings/mariadbkey.gpg`

Example 3: (`PWD=/home/user`)

sudo add-apt-key mariadb_release_signing_key.asc mariadbkey

Will use existing key in `/home/user`, convert it and store as `/usr/share/keyrings/mariadbkey.gpg`
Will use existing key in `/home/user`, convert it and store as `/etc/apt/keyrings/mariadbkey.gpg`

After installing the PGP key, it is also possible to add the key and repository to `/etc/apt/sources.list`
- The choice to add this will be presented in the script as the first input option
Expand Down
18 changes: 9 additions & 9 deletions add-apt-key
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh

# Add APT key script
# Version : 1.1.0-5
# Release : 2022-05-25
# Version : 1.1.1-6
# Release : 2022-07-07
# Author : Artur Meinild

# Initial configuration variables
keypath="/usr/share/keyrings/"
keypath="/etc/apt/keyrings/"
verbosity="No"
removetmp="No"

Expand Down Expand Up @@ -54,21 +54,21 @@ if [ "$1" = "--help" ]; then
echo " - Empty - output path is set in config, filename is taken from existing key"
echo ""
echo "This script has a config file /usr/local/etc/add-apt-key.conf, where the following variables can be set:"
echo " - keypath : path to store converted key - default is /usr/share/keyrings"
echo " - keypath : path to store converted key - default is /etc/apt/keyrings"
echo " - verbosity : if set to Yes - displays extra output"
echo " - removetmp : if set to Yes - remove input (non-converted) file"
echo ""
echo "Example 1: (PWD=/root)"
echo " sudo add-apt-key https://mariadb.org/mariadb_release_signing_key.asc /usr/local/share/keyrings/"
echo "Will download key in /root, convert it and store as /usr/local/share/keyrings/mariadb_release_signing_key.gpg"
echo " sudo add-apt-key https://mariadb.org/mariadb_release_signing_key.asc /usr/share/keyrings/"
echo "Will download key in /root, convert it and store as /usr/share/keyrings/mariadb_release_signing_key.gpg"
echo ""
echo "Example 2: (PWD=/home/user)"
echo " sudo add-apt-key /root/mariadb_release_signing_key.asc /usr/local/share/keyrings/mariadbkey"
echo "Will use existing key in /root, convert it and store as /usr/local/share/keyrings/mariadbkey.gpg"
echo " sudo add-apt-key /root/mariadb_release_signing_key.asc /usr/share/keyrings/mariadbkey"
echo "Will use existing key in /root, convert it and store as /usr/share/keyrings/mariadbkey.gpg"
echo ""
echo "Example 3: (PWD=/home/user)"
echo " sudo add-apt-key mariadb_release_signing_key.asc mariadbkey"
echo "Will use existing key in /home/user, convert it and store as /usr/share/keyrings/mariadbkey.gpg"
echo "Will use existing key in /home/user, convert it and store as /etc/apt/keyrings/mariadbkey.gpg"
echo ""
echo "After installing the PGP key, it is also possible to add the key and repository to /etc/apt/sources.list"
echo " - The choice to add this will be presented in the script as the first input option"
Expand Down
2 changes: 1 addition & 1 deletion add-apt-key.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Initial configuration variables
keypath="/usr/share/keyrings/"
keypath="/etc/apt/keyrings/"
verbosity="Yes"
removetmp="No"

0 comments on commit 1037895

Please # to comment.