dotfiles-remastered/.local/share/scripts/nc-share-text.sh

23 lines
410 B
Bash
Raw Normal View History

2021-02-12 18:50:39 +00:00
#!/usr/bin/env sh
set -e
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
source $XDG_CONFIG_HOME/nextcloud.config.sh
if test -n "$1"; then
FILE_PATH=$1
elif test ! -t 0; then
read -r FILE_PATH
else
>&2 echo "Provide a file"
exit 1
fi
2021-03-24 22:17:20 +00:00
$SCRIPTPATH/nc-share-file.sh "$FILE_PATH" \
2021-02-12 18:50:39 +00:00
| perl -n -e '/([a-zA-Z0-9]+)$/ && print $1' \
2021-03-07 00:09:00 +00:00
| awk -n -e '{print "https://pb.kapelle.org/"$1}'
2021-02-12 18:50:39 +00:00