Skip to content

Instantly share code, notes, and snippets.

@aarvay
Created October 7, 2011 10:01
Show Gist options
  • Save aarvay/1269944 to your computer and use it in GitHub Desktop.
Save aarvay/1269944 to your computer and use it in GitHub Desktop.
Bash script to manage fake git accounts
#!/bin/bash
#Script to switch between the orginal git account and the fake one.
#Setup
#=====
# Have two folders named "key_backup" and "fake_backup" in ~/.ssh/
# The original account's pubkey will be stored in key_backup/ and fake account's in fake_backup/
# --Aarvay
[ "$(ls -A ~/.ssh/fake_backup)" ] && { mv ~/.ssh/id_rsa* ~/.ssh/key_backup/; mv ~/.ssh/fake_backup/id_rsa* ~/.ssh/; echo "Switched to Fake Account!"; } || { mv ~/.ssh/id_rsa* ~/.ssh/fake_backup/; mv ~/.ssh/key_backup/id_rsa* ~/.ssh/; echo "Switched to Original Account!"; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment