16 lines
382 B
Bash
Executable file
16 lines
382 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# Get IP address
|
|
echo "Your IP address is "$(ip route get 1.1.1.1 | grep -oP 'src \K[^ ]+')
|
|
|
|
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
|
|
|
|
# Start Python's HTTP server
|
|
echo "Press Ctrl-C to stop the server when you are done"
|
|
python -m http.server
|