-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_send
More file actions
executable file
·65 lines (60 loc) · 1.86 KB
/
server_send
File metadata and controls
executable file
·65 lines (60 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
source ./secret_variables.sh
bitwarden_used="$1"
location="test"
if [[ "$bitwarden_used" == *"password"* ]]; then
echo "Using password manager (and sshpass)"
PASS=$(bw get password SSH:$USER); # 2>/dev/null
else
echo "(Passwork asked later, for scp)"
fi
PS3='Please enter your choice: '
options=("1. lab/published (for papers)" "2. lab/project-thumbnails (for images)" "3. lab/team-profile-photos (for mugshots)" "4. lab/essays" "5. plopes/project-thumbnails (on personal page)" "6. lab/sponsors" "7. lab/slides" "8. lab/news-images" "Quit")
select opt in "${options[@]}"
do
case $opt in
"1. lab/published (for papers)")
location="/apps/lab/published"
break
;;
"2. lab/project-thumbnails (for images)")
location="/apps/lab/project-thumbnails"
break
;;
"3. lab/team-profile-photos (for mugshots)")
location="/apps/lab/team-profile-photos"
break
;;
"4. lab/essays")
location="/apps/lab/essays"
break
;;
"5. plopes/project-thumbnails (on personal page)")
location="/apps/plopes/project-thumbnails/"
break
;;
"6. lab/sponsors")
location="/apps/lab/sponsors/"
break
;;
"7. lab/slides")
location="/apps/lab/slides/"
break
;;
"8. lab/news-images")
location="/apps/lab/news-images/"
break
;;
"Quit")
break
;;
*) echo "invalid option $REPLY";;
esac
done
if [ -z "$PASS" ]; then
# echo "Sending via scp..."
scp $@ $SERVER_LOCATION:/home/pedrolopes/$location/
else
# echo "Sending via sshpass..."
sshpass -p $PASS scp -r ${@:2} $SERVER_LOCATION:/home/pedrolopes/$location/
fi