feat: add service:links command
This allows users to script against apps that are linked to a given service
This commit is contained in:
@@ -468,7 +468,7 @@ service_link() {
|
||||
}
|
||||
|
||||
service_linked_apps() {
|
||||
declare desc="Lists all applications linked to a service"
|
||||
declare desc="Lists all apps linked to a service for info output"
|
||||
declare SERVICE="$1"
|
||||
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
||||
local LINKS_FILE="$SERVICE_ROOT/LINKS"
|
||||
@@ -479,6 +479,18 @@ service_linked_apps() {
|
||||
tr '\n' ' ' <"$LINKS_FILE"
|
||||
}
|
||||
|
||||
service_links() {
|
||||
declare desc="Lists all apps linked to a service"
|
||||
declare SERVICE="$1"
|
||||
local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
|
||||
local LINKS_FILE="$SERVICE_ROOT/LINKS"
|
||||
|
||||
touch "$LINKS_FILE"
|
||||
[[ -z $(<"$LINKS_FILE") ]] && return 0
|
||||
|
||||
cat "$LINKS_FILE"
|
||||
}
|
||||
|
||||
service_list() {
|
||||
declare desc="Lists all services and their status"
|
||||
local SERVICES=$(ls "$PLUGIN_DATA_ROOT" 2>/dev/null)
|
||||
|
||||
Reference in New Issue
Block a user