Skip to content
Closed

pull #62

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SOLDOUT_waiting_for_stock.list
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# name date
Love potion 7/12/1215
Excalibur 30/05/542
Philosopher's stone 23/22/2023
2 changes: 1 addition & 1 deletion product.list
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# product price
arrow 1
bow 25
philosopher's_stone 100
philosopher's_stone 0
88 changes: 88 additions & 0 deletions setup_ssh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
read -p "Do you want to setup the ssh authentification method to work outside of the game (y/n)?" globalinstall


cd ${GSH_HOME}
# first setup ~/.ssh as a symlink or as a real directory depending of the above choice.
if [[ "$globalinstall" == "y" ]];
then
if [ ! -d ${REAL_HOME}/.ssh ]
then
echo "creating ~/.ssh directory (outside the game)"
mkdir ${REAL_HOME}/.ssh
chmod 700 ${GSH_HOME}/.ssh
fi
# remove local directory if .ssh is not a symlink
# or create (or reset) the symlink
if [ ! -L ${GSH_HOME}/.ssh ] && [ -e ${GSH_HOME}/.ssh ]
then
rm -rf ${GSH_HOME}/.ssh &> /dev/null
elif [ -L ${GSH_HOME}/.ssh ]
then
unlink ${GSH_HOME}/.ssh &> /dev/null
ln -s ${REAL_HOME}/.ssh
else
ln -s ${REAL_HOME}/.ssh
fi
else
# need to have it's own directory:
if [ ! -L ${GSH_HOME}/.ssh ] && [ -e ${GSH_HOME}/.ssh ] # if a symlink -> unlink + create directory
then
unlink ${GSH_HOME}/.ssh &> /dev/null
elif [ -e ${GSH_HOME}/.ssh ] # hard directory already exists -> clean it
then
rm -rf ${GSH_HOME}/.ssh
fi

mkdir ${GSH_HOME}/.ssh
chmod 700 ${GSH_HOME}/.ssh
fi

#Now .ssh is setup either as a symlink (if user ask for global installation) or as an empty real directory.

# create ~/.ssh/id_rsa.git
if [ ! -e ~/.ssh/id_rsa.git ]
then
ssh-keygen -t rsa -f ~/.ssh/id_rsa.git -N ""
chmod 600 ~/.ssh/id_rsa.git
fi

if [[ "$globalinstall" == "y" ]];
then
identityfile_path="${REAL_HOME}/.ssh/id_rsa.git"
else
identityfile_path="${GSH_HOME}/.ssh/id_rsa.git"
fi

if [ ! -e ~/.ssh/config ]
then
echo "Host github.com" >> ~/.ssh/config
echo " Hostname github.com" >> ~/.ssh/config
echo " User git" >> ~/.ssh/config
echo " IdentityFile ${identityfile_path}" >> ~/.ssh/config
# handle the content of the ~/.ssh/config file
elif $(cat ~/.ssh/config | grep github.com &> /dev/null)
then
echo "file ~/.ssh/config already has instruction for github: The script did not try to edit it."
echo "We do expect the following lines: (please check)"
echo "Host github.com"
echo " Hostname github.com"
echo " User git"
echo " IdentityFile ${identityfile_path}"
else
echo "adding configuration for github in ssh config file"
echo "" >> ~/.ssh/config
echo "Host github.com" >> ~/.ssh/config
echo " Hostname github.com" >> ~/.ssh/config
echo " User git" >> ~/.ssh/config
echo " IdentityFile ${identityfile_path}" >> ~/.ssh/config
fi

echo ""
echo "Step 1 completed. Now you can do Step 2:"
echo ""
echo "go to https://github.com/settings/keys"
echo "click on "New ssh key" put as title the name of the cluster"
echo "and paste the following content:"
echo ""
echo ""
cat ~/.ssh/id_rsa.git.pub
1 change: 1 addition & 0 deletions status
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
I have succeed level 1
I have succeed level 14 on Tue Oct 14 15:36:16 CEST 2025