1 | #!/bin/ksh |
---|
2 | #------------------------------------------------------------------------------! |
---|
3 | # Current revisions: |
---|
4 | # ----------------- |
---|
5 | # |
---|
6 | # |
---|
7 | # Former revisions: |
---|
8 | # ----------------- |
---|
9 | # $Id: release_tutorial 916 2012-05-30 15:24:21Z maronga $ |
---|
10 | # |
---|
11 | # 915 2012-05-30 15:11:11Z maronga |
---|
12 | # Initial revision |
---|
13 | # |
---|
14 | # Description: |
---|
15 | # ------------ |
---|
16 | # Script for copying the compiled PDFs to a desired web directory. This script |
---|
17 | # should be used by user raasch only. |
---|
18 | # |
---|
19 | # Execution: |
---|
20 | # ---------- |
---|
21 | # release_tutorial --> Copy all PDF files to $release_directory (see below) |
---|
22 | #------------------------------------------------------------------------------! |
---|
23 | |
---|
24 | release_directory="/home/raasc/public_html/files" |
---|
25 | mod_dir_lecture="755" |
---|
26 | mod_dir_handout="755" |
---|
27 | mod_dir_web="755" |
---|
28 | mod_lecture="644" |
---|
29 | mod_handout="644" |
---|
30 | mod_web="644" |
---|
31 | |
---|
32 | full_name=`readlink -f $0` |
---|
33 | directory="$(dirname $full_name)/../TUTORIAL/SOURCE" |
---|
34 | input_dir="$(dirname $full_name)/../TUTORIAL" |
---|
35 | cd $input_dir |
---|
36 | |
---|
37 | printf "\n Files will be released in $release_directory/." |
---|
38 | printf "\n Subdirectories LECTURE, HANDOUT and WEB will be creared if necessary." |
---|
39 | printf "\n Start copying...\n" |
---|
40 | |
---|
41 | |
---|
42 | if [[ ! -d $release_directory/LECTURE ]] then |
---|
43 | printf " $release_directory/LECTURE will be created.\n" |
---|
44 | mkdir -p $release_directory/LECTURE |
---|
45 | chmod $mod_dir_lecture $release_directory/LECTURE |
---|
46 | fi |
---|
47 | cp LECTURE/*.pdf "$release_directory/LECTURE/" |
---|
48 | chmod $mod_lecture $release_directory/LECTURE/* |
---|
49 | printf " Finished LECTURE.\n" |
---|
50 | |
---|
51 | if [[ ! -d $release_directory/HANDOUT ]] then |
---|
52 | printf " $release_directory/HANDOUT will be created.\n" |
---|
53 | mkdir -p $release_directory/HANDOUT |
---|
54 | chmod $mod_dir_handout $release_directory/HANDOUT |
---|
55 | |
---|
56 | fi |
---|
57 | cp HANDOUT/*.pdf "$release_directory/HANDOUT/" |
---|
58 | chmod $mod_handout $release_directory/HANDOUT/* |
---|
59 | printf " Finished HANDOUT.\n" |
---|
60 | |
---|
61 | if [[ ! -d $release_directory/WEB ]] then |
---|
62 | printf " $release_directory/WEB will be created.\n" |
---|
63 | mkdir -p $release_directory/WEB |
---|
64 | chmod $mod_dir_web $release_directory/WEB |
---|
65 | fi |
---|
66 | cp WEB/*.pdf "$release_directory/WEB/" |
---|
67 | chmod $mod_web $release_directory/WEB/* |
---|
68 | printf " Finished WEB.\n" |
---|
69 | |
---|
70 | printf " \n +++ All actions finished.\n" |
---|
71 | |
---|
72 | exit |
---|
73 | |
---|
74 | |
---|
75 | |
---|