https://github.com/phx/webshare
https://github.com/phx/webshare
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/phx/webshare
- Owner: phx
- Created: 2021-04-14T18:32:06.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-14T18:48:59.000Z (about 5 years ago)
- Last Synced: 2025-01-29T10:33:52.594Z (over 1 year ago)
- Language: Shell
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# webshare
This script is used to easily copy files to a directory on a remote host that is used as the document root of a web index.
It supports nested directories and wildcards and copies the resulting URL or list of URLs to the clipboard.
## Instructions:
Change the following variables in the script:
```
URL='https://yourshareurl.com'
WEBROOT='/mnt/media/shared'
FILEHOST='user@host'
```
You should ideally have passwordless SSH set up for the `FILEHOST`.
The `clipboard()` function is currently set up for MacOS, but feel free to change it to your own clipboard copy command.
Ideally, copy `share.sh` into your `$PATH` as something like `share`.
## Usage:
```
share [-dir subdirectory_name] file(s)
```
### Example 1:
```
share file.txt
# This will create https://yourshareurl.com/file.txt
```
### Example 2:
Now let's say you have the following files in a `tools` directory:
```
filea.zip
fileb.zip
filec.zip
```
```
share -dir new_subdirectory tools/*
# This will create the following URLs:
# https://yourshareurl.com/new_subdirectory/tools/filea.zip
# https://yourshareurl.com/new_subdirectory/tools/fileb.zip
# https://yourshareurl.com/new_subdirectory/tools/filec.zip
```