blob: 25fc44065c1ade3cff24fc1af9d04c0e6c5d9ee1 (
plain) (
blame)
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
|
#!/bin/bash
if [ -z "$1" ]
then
printf 'Repository: '
read
set "$REPLY"
fi
set "$(echo -e "a\n$1\n.\n1s|\.\+/||g\n1s|/\+|/|g\n1p\nQ" | ed -sqr | tail -1)"
if [ ! -d "$1" ]
then
echo 'Not a directory!'
exit 1
fi
__rec_ro() {
while read -r f
do
[ ! -w "$f" ] && continue
chwrite +w "$f"
[ -d "$f" ] && __rec_ro "$f"
done <<FILES
$(ls -A1 "$1")
FILES
}
__rec_ro "$1"
|