Add support for the SUDO variable
This can be used to pick another tool to elevate privileges.
This commit is contained in:
parent
69fc8b8fc1
commit
d4c670bc44
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
program_version=@VERSION@
|
program_version=@VERSION@
|
||||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||||
|
SUDO="${SUDO:-sudo}"
|
||||||
|
|
||||||
if ! [ -f "$sharedir/functions.sh" ]; then
|
if ! [ -f "$sharedir/functions.sh" ]; then
|
||||||
echo "$sharedir/functions.sh: not found" >&2
|
echo "$sharedir/functions.sh: not found" >&2
|
||||||
|
@ -54,11 +55,10 @@ do_keygen() {
|
||||||
)
|
)
|
||||||
openssl rsa -in "$privkey" -pubout -out "$pubkey"
|
openssl rsa -in "$privkey" -pubout -out "$pubkey"
|
||||||
|
|
||||||
|
|
||||||
if [ -n "$install_pubkey" ]; then
|
if [ -n "$install_pubkey" ]; then
|
||||||
msg "Installing $pubkey to /etc/apk/keys..."
|
msg "Installing $pubkey to /etc/apk/keys..."
|
||||||
sudo mkdir -p /etc/apk/keys
|
$SUDO mkdir -p /etc/apk/keys
|
||||||
sudo cp -i "$pubkey" /etc/apk/keys/
|
$SUDO cp -i "$pubkey" /etc/apk/keys/
|
||||||
else
|
else
|
||||||
|
|
||||||
msg ""
|
msg ""
|
||||||
|
@ -101,6 +101,9 @@ usage() {
|
||||||
-q, --quiet
|
-q, --quiet
|
||||||
-h, --help Show this help
|
-h, --help Show this help
|
||||||
|
|
||||||
|
The SUDO variable can be set to pick which tool can be used to
|
||||||
|
elevate privileges, if it is not set it defaults to sudo.
|
||||||
|
|
||||||
__EOF__
|
__EOF__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue