Skip to content

Instantly share code, notes, and snippets.

@fabiode
Created May 18, 2016 15:59
Show Gist options
  • Save fabiode/ee0d1613a39f5184f0fd0af98926f955 to your computer and use it in GitHub Desktop.
Save fabiode/ee0d1613a39f5184f0fd0af98926f955 to your computer and use it in GitHub Desktop.
Cloud66 json substition for CX Toolbelt fast exchange between users
#!/bin/bash
file="$HOME/.cloud66/$1.json"
if [ -f "$file" ]
then
echo "$file found."
echo "erasing old cx.json, replacing for $1.json"
rm -rf "$HOME/.cloud66/cx.json"
ln -s $file "$HOME/.cloud66/cx.json"
else
echo "$file not found."
echo "You have these options below:"
ls_consult="$HOME/.cloud66/*.json"
ls $ls_consult | grep -v 'cx'
read -p "Choose one of the options, please: " FILENAME
new_file="$HOME/.cloud66/$FILENAME.json"
if [ -f "$new_file" ]
then
rm -rf "$HOME/.cloud66/cx.json"
ln -s $new_file "$HOME/.cloud66/cx.json"
echo "$new_file found."
echo "erasing old cx.json, replacing for $FILENAME.json"
else
echo "Not found. Try Again. =("
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment