diff --git a/ssm b/ssm index e361f28..64d40f1 100755 --- a/ssm +++ b/ssm @@ -309,6 +309,7 @@ restart() { "$_self" "$service_name" start } +edit() { "${EDITOR:-vim}" "$service_config"; } logs() { ${PAGER:-less} "$service_logfile"; } ## Status is a bit of a special case. It's talkative. @@ -397,9 +398,9 @@ main() { if [[ $1 == /* ]]; then service_config=$1 else - for i in "${service_path[@]}"; do - [[ -f "$i/$1" ]] && { - service_config="$i/$1" + for i in "${service_path[@]/%//$service_name}"; do + [[ -f "$i" ]] && { + service_config=$i break } done