.
This commit is contained in:
@ -38,8 +38,6 @@ print_usage() {
|
||||
echo " version - Show version information"
|
||||
echo " status - Check system status"
|
||||
echo " servers - List configured servers"
|
||||
echo " services - List configured services"
|
||||
echo " templates - List available templates"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -v, --verbose Enable verbose output"
|
||||
@ -64,47 +62,7 @@ check_status() {
|
||||
|
||||
# Function to list servers
|
||||
list_servers() {
|
||||
echo -e "${GREEN}Configured Servers:${NC}"
|
||||
if [ -d "$USER_DEFINITIONS/servers" ]; then
|
||||
for server in "$USER_DEFINITIONS/servers"/*.json; do
|
||||
if [ -f "$server" ]; then
|
||||
name=$(jq -r '.name' "$server")
|
||||
host=$(jq -r '.host' "$server")
|
||||
echo "- $name ($host)"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "No servers configured"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to list services
|
||||
list_services() {
|
||||
echo -e "${GREEN}Configured Services:${NC}"
|
||||
if [ -d "$USER_DEFINITIONS/services" ]; then
|
||||
for service in "$USER_DEFINITIONS/services"/*.json; do
|
||||
if [ -f "$service" ]; then
|
||||
name=$(jq -r '.name' "$service")
|
||||
echo "- $name"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "No services configured"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to list templates
|
||||
list_templates() {
|
||||
echo -e "${GREEN}Available Templates:${NC}"
|
||||
if [ -d "$USER_DEFINITIONS/templates" ]; then
|
||||
for template in "$USER_DEFINITIONS/templates"/*.sh; do
|
||||
if [ -f "$template" ]; then
|
||||
echo "- $(basename "$template")"
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "No templates available"
|
||||
fi
|
||||
}
|
||||
|
||||
# Main script logic
|
||||
@ -121,12 +79,6 @@ case "$1" in
|
||||
"servers")
|
||||
list_servers
|
||||
;;
|
||||
"services")
|
||||
list_services
|
||||
;;
|
||||
"templates")
|
||||
list_templates
|
||||
;;
|
||||
"")
|
||||
echo -e "${RED}Error: No command provided${NC}"
|
||||
print_usage
|
||||
|
Reference in New Issue
Block a user