2013-10-26 21:28:38 +00:00
|
|
|
#!/bin/sh -e
|
2008-07-24 07:29:50 +00:00
|
|
|
|
2013-10-26 21:28:38 +00:00
|
|
|
file="$1"
|
2019-04-12 16:18:39 +00:00
|
|
|
host=staticweb.ungleich.ch
|
|
|
|
dir=/home/services/www/nico/www.nico.schottelius.org/www/temp
|
2019-04-12 16:46:31 +00:00
|
|
|
url="https://www.nico.schottelius.org/temp"
|
2008-07-24 07:29:50 +00:00
|
|
|
|
2020-05-20 22:35:50 +00:00
|
|
|
delete_after=""
|
|
|
|
|
2008-07-24 07:29:50 +00:00
|
|
|
[ -z "$file" ] && exit 1
|
|
|
|
|
2020-05-20 22:35:50 +00:00
|
|
|
if [ "$file" = "-" ]; then
|
|
|
|
file=$(mktemp)
|
|
|
|
cat > "$file"
|
|
|
|
delete_after=yes
|
|
|
|
fi
|
|
|
|
|
2008-07-24 07:29:50 +00:00
|
|
|
bfile="$(basename "$file")"
|
|
|
|
|
2021-04-01 11:55:40 +00:00
|
|
|
scp -r "$file" "${host}:${dir}"
|
2021-04-05 14:46:58 +00:00
|
|
|
ssh "$host" "chmod a+r -R \"$dir/$bfile\""
|
2008-07-24 07:29:50 +00:00
|
|
|
|
2020-05-20 22:35:50 +00:00
|
|
|
if [ "$delete_after" ]; then
|
|
|
|
rm -f "$file"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "${url}/${bfile}"
|