-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
joseph
authored and
joseph
committed
Feb 13, 2022
1 parent
852a5b8
commit 0f60626
Showing
2 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
|
||
#!/bin/sh | ||
|
||
#### EDIT THESE VARIABLES #### | ||
# The URL or IP of your server | ||
serverURL="yourserver.com" | ||
# The username and password of the remote user you'll be using SFTP with | ||
serverUsername="user" | ||
serverPassword="strongandcomplicatedpassword" | ||
# The port expected by the server | ||
serverPort=22 | ||
# Remote path to upload the file to | ||
remote_path=/var/www/public/ | ||
# The URL (excluding file name) you expect the file to have to be accessible | ||
expectedURL="https://yourserver.com/public/" | ||
|
||
local_path=$1 | ||
sshpass -p $serverPassword scp -P $serverPort $local_path $serverUsername@$serverURL:$remote_path | ||
fileName=$(basename $local_path) | ||
link=$expectedURL$fileName | ||
echo $link | xclip | ||
notify-send --app-name="Server Upload" --icon="cloud-upload" "Link copied to xclip $link" --expire-time=5000 > /dev/null 2>&1 |