OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 #--------------------------------------------- | 2 #--------------------------------------------- |
3 # xdg-copy | 3 # xdg-copy |
4 # | 4 # |
5 # Utility script to copy files specified by URLs, including | 5 # Utility script to copy files specified by URLs, including |
6 # downloading and uploading from/to remote sites. | 6 # downloading and uploading from/to remote sites. |
7 # | 7 # |
8 # Refer to the usage() function below for usage. | 8 # Refer to the usage() function below for usage. |
9 # | 9 # |
10 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> | 10 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 if [ $? -eq 0 ]; then | 234 if [ $? -eq 0 ]; then |
235 exit_success | 235 exit_success |
236 else | 236 else |
237 exit_failure_operation_failed | 237 exit_failure_operation_failed |
238 fi | 238 fi |
239 } | 239 } |
240 | 240 |
241 copy_gnome() | 241 copy_gnome() |
242 { | 242 { |
243 gnomevfs-copy "$1" "$2" | 243 if gvfs-copy --help 2>/dev/null 1>&2; then |
| 244 gvfs-copy "$1" "$2" |
| 245 else |
| 246 gnomevfs-copy "$1" "$2" |
| 247 fi |
244 | 248 |
245 if [ $? -eq 0 ]; then | 249 if [ $? -eq 0 ]; then |
246 exit_success | 250 exit_success |
247 else | 251 else |
248 exit_failure_operation_failed | 252 exit_failure_operation_failed |
249 fi | 253 fi |
250 } | 254 } |
251 | 255 |
252 [ x"$1" != x"" ] || exit_failure_syntax | 256 [ x"$1" != x"" ] || exit_failure_syntax |
253 | 257 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 ;; | 294 ;; |
291 | 295 |
292 gnome) | 296 gnome) |
293 copy_gnome "$source" "$dest" | 297 copy_gnome "$source" "$dest" |
294 ;; | 298 ;; |
295 | 299 |
296 *) | 300 *) |
297 exit_failure_operation_impossible "no method available for copying '$source'
to '$dest'" | 301 exit_failure_operation_impossible "no method available for copying '$source'
to '$dest'" |
298 ;; | 302 ;; |
299 esac | 303 esac |
OLD | NEW |