-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdex-show
executable file
·43 lines (33 loc) · 1.01 KB
/
dex-show
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/dash
# Copyright (c) 2014 - 2016 Luigi Tarenga <[email protected]>
# Distributed under the terms of a MIT license.
# parameters: [ lock_name ]
export LANG=C
cd ${0%/*}
lname=${1:-default}
read lock_servers < conf/lock_servers
read rpath < conf/remote_path
read sshopt < conf/sshopt
if [ -f temp/${lname}_counter ] ; then
read counter < temp/${lname}_counter
read holder term seq previous < temp/${lname}_htsp
echo local term seq for $lname:
echo holder: $holder
echo term: $term
echo seq: $seq
echo counter: $counter
echo previous: $previous
else
echo lock $lname not initialized
fi
read hostname majority < temp/${lname}_params
echo
echo remote state sequence for $lname:
echo lock_server holder term seq
for h in $lock_servers ; do
echo $h: $(ssh $sshopt $h "cd $rpath ; " \
"[ -f state/$lname ] && " \
"cat state/$lname || " \
"echo lock file not found")
done
echo