chore: move to helper functions for fetching passwords
This commit is contained in:
@@ -586,6 +586,26 @@ service_parse_args() {
|
||||
shift "$((OPTIND - 1))" # remove options from positional parameters
|
||||
}
|
||||
|
||||
service_password() {
|
||||
declare desc="Fetch the password for a service"
|
||||
declare SERVICE="$1"
|
||||
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
||||
local PASSWORD_FILE="$SERVICE_ROOT/PASSWORD"
|
||||
if [[ -f "$PASSWORD" ]]; then
|
||||
cat "$PASSWORD_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
service_root_password() {
|
||||
declare desc="Fetch the root password for a service"
|
||||
declare SERVICE="$1"
|
||||
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
||||
local PASSWORD_FILE="$SERVICE_ROOT/ROOTPASSWORD"
|
||||
if [[ -f "$PASSWORD" ]]; then
|
||||
cat "$PASSWORD_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
service_port_expose() {
|
||||
declare desc="Wrapper for exposing service ports"
|
||||
declare SERVICE="$1"
|
||||
|
||||
Reference in New Issue
Block a user