4 # this file defines a few convenience bash shorthands for managing myplc nodes
5 # it is installed in /usr/share/myplc/aliases
6 # you might wish to use it in your own bash startup files (.profile/.bashrc)
8 ssh_options="-o BatchMode=yes -o StrictHostKeyChecking=no"
10 function node_key () {
13 echo Running "$@" on root@"$hostname"
14 ssh $ssh_options -i "$key" "root@$hostname" "$@"
17 function nodes_key () {
20 for hostname in $(grep -v '#' $filename); do
21 node_boot "$hostname" "$key" "$@"
25 function node_dbg () {
26 [[ -z "$@" ]] && { echo "Usage: $0 hostname [command]" ; return 1; }
27 node_key /etc/planetlab/debug_ssh_key.rsa "$@"
29 function nodes_dbg () {
30 [[ -z "$@" ]] && { echo "Usage: $0 hosts_file [command]" ; return 1; }
31 node_keys /etc/planetlab/debug_ssh_key.rsa "$@"
33 function clear_known_hosts () {
34 for hostname in "$@"; do
35 sed -i "/$hostname/d" ~/.ssh/known_hosts
42 # navigators - alphabetical
43 alias gobmsource="cd /usr/share/bootmanager"
44 alias goboot="cd /var/www/html/boot"
45 alias godrupal="cd /var/www/html/planetlab"
46 alias gohttplog="cd /var/log/httpd"
47 alias goinit="cd /etc/plc.d"
48 alias golog="cd /var/log/"
49 alias goplcapi="cd /usr/share/plc_api"
50 alias gosqllog="cd /var/lib/pgsql/data/pg_log"
51 alias goyum="cd /var/www/html/install-rpms"