File: scpscript

package info (click to toggle)
cmph 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 6,748 kB
  • sloc: ansic: 10,582; cpp: 2,429; makefile: 151; sh: 111; python: 48; xml: 5
file content (49 lines) | stat: -rwxr-xr-x 1,078 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

upload_opt=

while getopts "u:" opt; do
    case $opt in
        u)
            upload_opt="$OPTARG"
        ;;
    esac
done

function usage {
    echo "Usage: $0 -u <upload_opt>"
    echo "-u <upload_opt> What to upload. It can be either of the following options:"
    echo " * html"
    echo " * examples"
    echo " * papers"
    echo " * all"
    exit 1
}

if [ "$upload_opt" = "" ] 
then
    usage
fi

if [ "$upload_opt" != "html" ] && 
   [ "$upload_opt" != "examples" ] && 
   [ "$upload_opt" != "papers" ] && 
   [ "$upload_opt" != "all" ]
then
    usage
fi
 
if [ "$upload_opt" = "html" ] || [ "$upload_opt" = "all" ]
then
    scp -r *.html  fc_botelho@web.sourceforge.net:/home/project-web/cmph/htdocs/
fi

if [ "$upload_opt" = "examples" ] || [ "$upload_opt" = "all" ]
then
    scp -r examples/*.c examples/keys.txt fc_botelho@web.sourceforge.net:/home/project-web/cmph/htdocs/examples/
fi

if [ "$upload_opt" = "papers" ] || [ "$upload_opt" = "all" ]
then
    scp -r papers/*.pdf fc_botelho@web.sourceforge.net:/home/project-web/cmph/htdocs/papers/
fi