mirror of
https://gh.wpcy.net/https://github.com/CaptainCore/captaincore.git
synced 2026-04-23 10:37:23 +08:00
28 lines
No EOL
575 B
Bash
28 lines
No EOL
575 B
Bash
#!/usr/bin/env bash
|
|
|
|
#
|
|
# Delete a SSH Key to CaptainCore CLI.
|
|
#
|
|
# `captaincore keys delete`
|
|
#
|
|
# --id=<id>
|
|
#
|
|
|
|
# Load configuration
|
|
root_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; root_path=${root_path%app*}
|
|
source ${root_path}lib/arguments
|
|
|
|
run_command() {
|
|
rm "$path_keys/${captain_id}/${id}"
|
|
}
|
|
|
|
# See if any sites are specifed
|
|
if [ ${#arguments[*]} -eq 0 ]; then
|
|
# Runs on specifed sites
|
|
run_command
|
|
fi
|
|
|
|
# Error if no sites specifed
|
|
if [ ${#arguments[*]} -gt 1 ]; then
|
|
echo -e "${COLOR_RED}Error:${COLOR_NORMAL} Please specify an --id=<id>."
|
|
fi |