#!/bin/sh # Variables student_id='guillem.george' server_url='cri.epita.fr' afs_path="/afs/${server_url}/user/g/gu/${student_id}/u/" mount_path="$HOME/Drives/afs" # Functions connect() { kinit -f $student_id@CRI.EPITA.FR sshfs -o reconnect $student_id@ssh.$server_url:$afs_path $mount_path cd $mount_path } reconnect() { kinit -f $student_id@CRI.EPITA.FR } print_help() { echo "Usage: $0 (connect|reconnect)" echo echo " connect Mounts the AFS on the specified folder" echo " reconnect Fix filesystem not responding problem" } # Handle arguments if [ $# -eq 0 ]; then connect elif [ $# -eq 1 ]; then if [ $1 == "connect" ]; then connect elif [ $1 == "reconnect" ]; then reconnect fi else print_help fi ## Warning you need to adjust your ssh config file correctly to make ## it work. Just add the following lines: # Host ssh.cri.epita.fr # GSSAPIAuthentication yes # GSSAPIDelegateCredentials yes ## You'll also need to configure your keys properly in your CRI profile