| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# Copyright : (C) see the 'copyright' file. |
| 4 |
# E-mail : see the 'copyright' file. |
| 5 |
# |
| 6 |
# |
| 7 |
# This program is free software; you can redistribute it and/or |
| 8 |
# modify it under the terms of the GNU General Public License |
| 9 |
# as published by the Free Software Foundation; either version 3 |
| 10 |
# of the License, or (at your option) any later version. |
| 11 |
# |
| 12 |
# This program is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# http://www.gnu.org/licenses/licenses.html#GPL |
| 17 |
|
| 18 |
### d'après un script posté par naholyr sur ubuntu-fr.org, adapte pour Cairo-Dock. |
| 19 |
|
| 20 |
TMP=$(tempfile) # tool available in Debian packages |
| 21 |
if test "$TMP" = ""; then |
| 22 |
TMP=$(mktemp) # /tmp/tmp.XXXXXXXXXX |
| 23 |
if test "$TMP" = ""; then |
| 24 |
TMP="/tmp/cairo_dock_curl_free" |
| 25 |
fi |
| 26 |
fi |
| 27 |
|
| 28 |
curl -q -v -T "$1" --limit-rate $2 -u [email protected]:toto ftp://dl.free.fr/ 2> "$TMP" |
| 29 |
|
| 30 |
if test $? -eq 0; then |
| 31 |
URL=$(grep -i -F "Il est disponible via" $TMP | grep -o "http:[^ ]*") |
| 32 |
if test "x$URL" != "x" ; then |
| 33 |
echo $URL |
| 34 |
fi |
| 35 |
fi |
| 36 |
rm -f "$TMP" |
| 37 |
exit 0 |