22 lines
397 B
Plaintext
22 lines
397 B
Plaintext
|
#!/usr/bin/env zsh
|
||
|
# Put files on a webspace via sftp
|
||
|
|
||
|
if [[ ${ARGC} -eq 0 ]]; then
|
||
|
print -u 2 "Usage: ${0} <file> …" >&2
|
||
|
return 1
|
||
|
fi
|
||
|
|
||
|
local -a putcmds
|
||
|
for file in "${@}"; do
|
||
|
putcmds+="put ${file}"
|
||
|
done
|
||
|
|
||
|
sftp tastytea.de <<EOF
|
||
|
cd /var/www/tastytea.de/files/
|
||
|
$(print -l ${putcmds})
|
||
|
EOF
|
||
|
|
||
|
for file in "${@}"; do
|
||
|
print '\e[1;95m→\e[0m' https://tastytea.de/files/"${file##*/}"
|
||
|
done
|