-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlftp-packing-cygwin.7zip.sh
46 lines (44 loc) · 1.09 KB
/
lftp-packing-cygwin.7zip.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
#!/bin/bash
if [ $# -eq 0 ]
then
echo "<script> name"
exit
fi
if [ ! -f lftp.exe ];
then
echo "lftp.exe doesn't exist run this file from where it exists"
exit
fi
cwd=`pwd`
items=`ldd.exe lftp.exe | grep --invert-match Windows | cut -d " " -f3`
tmpdir=`mktemp.exe --directory`
echo "Creating temporary directory $tmpdir"
mkdir $tmpdir/bin
mkdir $tmpdir/etc
for item in $items
do
echo "Copying LFTP dependency file: $item to $tmpdir/bin"
cp $item $tmpdir/bin
done
items=`ldd.exe /bin/ssh.exe | grep --invert-match Windows | cut -d " " -f3`
for item in $items
do
echo "Copying SSH dependency file: $item"
cp $item $tmpdir/bin
done
items=`ldd.exe /bin/bash.exe | grep --invert-match Windows | cut -d " " -f3`
for item in $items
do
echo "Copying BASH dependency file: $item"
cp $item $tmpdir/bin
done
echo "Copying required files"
cp lftp.exe $tmpdir/bin
cp ../lftp.conf $tmpdir/etc
cp /bin/ssh.exe $tmpdir/bin
cp /bin/bash.exe $tmpdir/bin
cd $tmpdir
/cygdrive/c/Program\ Files\ \(x86\)/7-Zip/7z.exe a ../$1.7z .
mv ../$1.7z /cygdrive/c/lftpbuilding/compiled
cd $cwd
echo "File generated: $1.7z"