-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwhat-s_installed-everywhere.sh
executable file
·69 lines (62 loc) · 1.96 KB
/
what-s_installed-everywhere.sh
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
cd $(dirname $0) || exit 1
PKGs_local=$(ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
SHORT_HOSTNAME=$(hostname -s)
if [ "$SHORT_HOSTNAME" == "tibou" ]; then
PKGs_tibou=$PKGs_local
else
PKGs_tibou=$(ssh tibou ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
fi
if [ "$SHORT_HOSTNAME" == "titplume" ]; then
PKGs_titplume=$PKGs_local
else
PKGs_titplume=$(ssh titplume ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
fi
if [ "$SHORT_HOSTNAME" == "tibonom" ]; then
PKGs_tibonom=$PKGs_local
else
PKGs_tibonom=$(ssh tibonom ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
fi
if [ "$SHORT_HOSTNAME" == "gwenhael" ]; then
PKGs_gwenhael=$PKGs_local
else
PKGs_gwenhael=$(ssh gwenhael ls /var/lib/pkgtools/packages/ | sed 's|^\(.*\)-.*-.*-.*$|\1|')
fi
PKG_OK="| x "
PKG_KO="| "
counter=0
echo "| tibou | titplume | tibonom | gwenhael | NB |"
echo "|----------+----------+----------+----------+----+-----"
for cat in a ap d fonts l n xap y; do
cd $cat
for p in $(ls -1); do
if echo -n $PKGs_tibou | grep -q " $(echo $p | tr -d /) "; then
echo -n "$PKG_OK";
counter=$((counter + 1));
else
echo -n "$PKG_KO";
fi
if echo -n $PKGs_titplume | grep -q " $(echo $p | tr -d /) "; then
echo -n "$PKG_OK";
counter=$((counter + 1));
else
echo -n "$PKG_KO";
fi
if echo -n $PKGs_tibonom | grep -q " $(echo $p | tr -d /) "; then
echo -n "$PKG_OK";
counter=$((counter + 1));
else
echo -n "$PKG_KO";
fi
if echo -n $PKGs_gwenhael | grep -q " $(echo $p | tr -d /) "; then
echo -n "$PKG_OK";
counter=$((counter + 1));
else
echo -n "$PKG_KO";
fi
echo -n "| $counter "
echo "| $cat/$p"
counter=0
done | sort
cd ..
done