2 # this file defines a few convenience bash shorthands for managing myplc nodes
3 # it is installed in /usr/share/myplc/aliases
4 # you might wish to use it in your own bash startup files (.profile/.bashrc)
6 ssh_options="-o BatchMode=yes -o StrictHostKeyChecking=no"
11 echo Running "$@" on root@"$hostname"
12 ssh $ssh_options -i "$key" "root@$hostname" "$@"
15 function nodes_key () {
18 for hostname in $(grep -v '#' $filename); do
19 node_boot "$hostname" "$key" "$@"
23 function node_dbg () {
24 [[ -z "$@" ]] && { echo "Usage: $0 hostname [command]" ; return 1; }
25 node_key /etc/planetlab/debug_ssh_key.rsa "$@"
27 function node_boot () {
28 [[ -z "$@" ]] && { echo "Usage: $0 hostname [command]" ; return 1; }
29 node_key /etc/planetlab/root_ssh_key.rsa "$@"
32 function nodes_dbg () {
33 [[ -z "$@" ]] && { echo "Usage: $0 hosts_file [command]" ; return 1; }
34 node_keys /etc/planetlab/debug_ssh_key.rsa "$@"
36 function nodes_boot () {
37 [[ -z "$@" ]] && { echo "Usage: $0 hosts_file [command]" ; return 1; }
38 nodes_key /etc/planetlab/root_ssh_key.rsa "$@"
41 function clear_keys () {
42 for hostname in "$@"; do
43 sed -i "/$hostname/d" ~/.ssh/known_hosts