Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Added TODO and list_labels_and_ids macro
Browse files Browse the repository at this point in the history
  • Loading branch information
rwky committed Jul 17, 2011
1 parent 73943a9 commit 63e5be3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add error handling
19 changes: 19 additions & 0 deletions linode_bash_api_macros
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,22 @@ fi
api_request

}


function list_labels_and_ids {
COMMAND="linode.list"
RESPONSE=`api_request`
for l in $RESPONSE
do
if [[ $l == *LABEL* ]]
then
echo -n "Label: "
echo -n "$l" | sed 's/"LABEL":"\(.*\)"/\1/' | tr -d "\n"
fi
if [[ $l == *LINODEID* ]]
then
echo -n " ID: "
echo $l | sed 's/"LINODEID":https://'
fi
done
}

0 comments on commit 63e5be3

Please sign in to comment.