-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·23 lines (18 loc) · 785 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·23 lines (18 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
################################################################################
set -e
set -u
################################################################################
ssh_host="ursula.pmade.com"
ssh_dir="/var/lib/websites/devalot.com/shared/files/webdev"
################################################################################
if [ $# -ne 1 ] || [ ! -e "$1" ]; then
>&2 echo "give the name of a zip file to upload"
exit
fi
################################################################################
short_name=$(basename "$ssh_dir").zip
long_name=$(basename "$1")
################################################################################
scp "$1" "${ssh_host}:${ssh_dir}"
ssh "$ssh_host" "cd $ssh_dir && ln -nfs $long_name $short_name"