diff --git a/tools/k9s-run.sh b/tools/k9s-run.sh index f8c9181..2b83960 100755 --- a/tools/k9s-run.sh +++ b/tools/k9s-run.sh @@ -3,9 +3,17 @@ # Run k9s with custom configuration #=========================================================================== -#--- Customize k9s configuration K9S_CONFIG_FILE="${K9S_CONFIG_DIR}/config.yaml" +#--- Clean obsolete configuration files +if [ -f ${K9S_CONFIG_DIR}/config.yml ] ; then + rm -f {K9S_CONFIG_DIR}/config.yml > /dev/null 2>&1 +fi +if [ -f ${K9S_CONFIG_DIR}/plugin.yml ] ; then + rm -f {K9S_CONFIG_DIR}/plugin.yml > /dev/null 2>&1 +fi + +#--- Customize k9s configuration if [ -f ${K9S_CONFIG_FILE} ] ; then #--- Disable K9S logo to display options sed -i "s+logoless:.*+logoless: true+" ${K9S_CONFIG_FILE} @@ -17,4 +25,5 @@ if [ -f ${K9S_CONFIG_FILE} ] ; then sed -i "s+skipLatestRevCheck:.*+skipLatestRevCheck: true+" ${K9S_CONFIG_FILE} fi +#--- Run k9s binary k9s \ No newline at end of file diff --git a/tools/profile b/tools/profile index 572cc47..662c47c 100644 --- a/tools/profile +++ b/tools/profile @@ -80,16 +80,10 @@ EOF export KUBE_EDITOR="/usr/local/bin/kubectl-ro-editor.sh" #--- Set k9s config path, delete obsolete configurations and create k9s plugins -export K9S_CONFIG_DIR=${HOME}/.k9s +export K9S_CONFIG_DIR="${HOME}/.k9s" if [ ! -d ${K9S_CONFIG_DIR} ] ; then mkdir -p ${K9S_CONFIG_DIR} fi -if [ -f ${K9S_CONFIG_DIR}/config.yml ] ; then - rm -f {K9S_CONFIG_DIR}/config.yml > /dev/null 2>&1 -fi -if [ -f ${K9S_CONFIG_DIR}/plugin.yml ] ; then - rm -f {K9S_CONFIG_DIR}/plugin.yml > /dev/null 2>&1 -fi cp /home/bosh/.k9s/plugins.yaml ${K9S_CONFIG_DIR}/plugins.yaml