Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small script I use for csshX #86

Open
goldencut opened this issue Aug 2, 2017 · 0 comments
Open

Small script I use for csshX #86

goldencut opened this issue Aug 2, 2017 · 0 comments

Comments

@goldencut
Copy link

goldencut commented Aug 2, 2017

#!/bin/bash
# echo "Can also be started with cluster name as first and only parameter on command line."
# Username to use on servers:
loginuser=martin
# For some fancy text:
und=`tput smul`
bold=`tput bold`
norm=`tput sgr0`
# Here we go:
if [ -z "$1" ]; then
        grep clusters ~/.csshrc
        read -p "Cluster to connect to (or 'list ${bold}clustername${norm}' or 'list all'): " connectto listit
                while [ $connectto = "list" ]
                do
                  if [ $listit = "all" ]; then
                        grep -v "clusters =" ~/.csshrc
                        read -p "Cluster to connect to (or 'list ${bold}clustername${norm}' or 'list all'): " connectt$
                  else
                        grep "^$listit " ~/.csshrc
                        read -p "Cluster to connect to (or 'list ${bold}clustername${norm}' or 'list all'): " connectt$
                  fi
                done
        echo "Connecting to cluster ${und}$connectto${norm} as ${und}$loginuser${norm}"
        csshX -screen 2 -l $loginuser $connectto
else
        echo "Connecting to cluster ${und}$1${norm} as ${und}$loginuser${norm}"
        csshX -screen 2 -l $loginuser $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant