-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathweb_unrar_from_to.sh
executable file
·56 lines (46 loc) · 1002 Bytes
/
web_unrar_from_to.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
#!/bin/bash
LOGG="/home/fille/Loggar/unrar.eloeldh.se"
FROM="/home/unrar.eloeldh.se/cgi-bin/fromFile.txt"
TO="/home/unrar.eloeldh.se/cgi-bin/toFile.txt"
TEMP1="/home/fille/temp1.txt"
TEMP2="/home/fille/temp2.txt"
TEMP3="/home/fille/temp3.txt"
TEMP4="/home/fille/temp4.txt"
QUOTE="/home/unrar.eloeldh.se/cgi-bin/citattecken"
touch $LOGG
touch $TEMP1
touch $TEMP2
touch $TEMP3
touch $TEMP4
exec >> $LOGG 2>&1
echo ""
echo "---------------------------"
echo "New run"
date "+%Y-%m-%d %H:%M"
echo ""
if [ -s $FROM ] && [ -s $TO ]
then
paste $QUOTE $FROM $QUOTE | tr -d '\011' >> $TEMP1
paste $QUOTE $TO $QUOTE | tr -d '\011' >> $TEMP2
paste $TEMP1 $TEMP2 >> $TEMP3
while read line
do
echo $line >> $TEMP4
done <$TEMP3
while read line
do
# /home/fille/scripts/unrar_from_to.sh $line
echo $line
done <$TEMP4
else
echo "Nothing to unrar"
fi
echo "---------------------------"
#rm $FROM
#rm TO
rm $TEMP1
rm $TEMP2
rm $TEMP3
rm $TEMP4
cat /dev/null > $FROM
cat /dev/null > $TO