Mercurial > hg > cc > valhalla
comparison bin/setup @ 0:fdd3f8a16fd4 default tip
shared scripts on valhalla cluster
author | Henry Thompson <ht@markup.co.uk> |
---|---|
date | Sat, 14 Mar 2020 11:00:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:fdd3f8a16fd4 |
---|---|
1 #!/bin/bash | |
2 | |
3 SHARED=/home/shared/ht | |
4 | |
5 link () { | |
6 rm -f "$2" | |
7 ln -s "$1" "$2" | |
8 } | |
9 | |
10 link $SHARED $HOME/shared | |
11 link $SHARED/.profile $HOME/.profile | |
12 link $SHARED/.ia $HOME/.ia | |
13 | |
14 mkdir -p $HOME/.ssh | |
15 chmod 700 $HOME/.ssh | |
16 | |
17 if [ -f $HOME/.ssh/authorized_keys ] | |
18 then | |
19 if cmp -s $SHARED/.ssh/authorized_keys $HOME/.ssh/authorized_keys | |
20 then | |
21 : | |
22 else | |
23 cat $SHARED/.ssh/authorized_keys >> $HOME/.ssh/authorized_keys | |
24 fi | |
25 else | |
26 cp $SHARED/.ssh/authorized_keys $HOME/.ssh/authorized_keys | |
27 chmod 600 $HOME/.ssh/authorized_keys | |
28 fi | |
29 | |
30 |