improved nc share
This commit is contained in:
parent
4c250aecf9
commit
425e4f2bdc
1
.local/bin/nc-share
Symbolic link
1
.local/bin/nc-share
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../share/scripts/nc-share.sh
|
@ -1 +0,0 @@
|
|||||||
../share/scripts/nc-share-file.sh
|
|
@ -20,7 +20,5 @@ FILENAME=$(basename $FILE_PATH)
|
|||||||
|
|
||||||
$SCRIPTPATH/nc-share-file.sh "$FILENAME" \
|
$SCRIPTPATH/nc-share-file.sh "$FILENAME" \
|
||||||
| perl -n -e '/([a-zA-Z0-9]+)$/ && print $1' \
|
| perl -n -e '/([a-zA-Z0-9]+)$/ && print $1' \
|
||||||
| awk -n -e '{print "https://pb.kapelle.org/"$1}' \
|
| awk -n -e '{print "https://pb.kapelle.org/"$1}'
|
||||||
| xclip -i -selection "clipboard"
|
|
||||||
|
|
||||||
|
|
||||||
|
25
.local/share/scripts/nc-share.sh
Executable file
25
.local/share/scripts/nc-share.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT=$(readlink -f "$0")
|
||||||
|
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
FILENAME=$(basename $FILE_PATH)
|
||||||
|
|
||||||
|
|
||||||
|
if file -i -b "$FILENAME" | grep "text" &> /dev/null; then
|
||||||
|
$SCRIPTPATH/nc-share-text.sh "$FILENAME"
|
||||||
|
else
|
||||||
|
$SCRIPTPATH/nc-share-file.sh "$FILENAME"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user