Fix a few mistakes in the script

This commit is contained in:
Anthony Wang 2021-07-21 10:55:44 -05:00
parent 031974f2e6
commit d1db250a88
Signed by: a
GPG key ID: BC96B00AEC5F2D76

3
share.sh Normal file → Executable file
View file

@ -3,9 +3,10 @@
# Get IP address
echo "Your IP address is "$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+')
if [ "$#" -ne 1 ]; then
if [ "$#" -eq 1 ]; then
ln $1 . # Link file to current directory
else
touch share.txt # Creat the file
xdg-open share.txt # Open file in default editor
fi