~writer-devs/writer/trunk

« back to all changes in this revision

Viewing changes to scripts/install.sh

  • Committer: Anthony Huben
  • Date: 2015-04-10 17:45:22 UTC
  • Revision ID: harp37@gmail.com-20150410174522-y2g5cf1yh19s189i
Delete scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
# Check if root
4
 
SUDO=''
5
 
if [ $EUID -ne 0 ]; then
6
 
    SUDO='sudo'
7
 
fi
8
 
 
9
 
 
10
 
 
11
 
# Compile Writer
12
 
./build.sh
13
 
 
14
 
# Install Writer (if compiling was successful)
15
 
if [ $? -eq 0 ]; then
16
 
    ERRORS=0
17
 
    
18
 
    echo
19
 
    echo "INSTALLING Writer..."
20
 
    echo "===================="
21
 
    echo
22
 
 
23
 
    # Copy executable to bin
24
 
    echo 'Copying executable to: /usr/bin/writer'
25
 
    $SUDO cp ../writer /usr/bin/
26
 
    if [ $? -ne 0 ]; then
27
 
        ERRORS=$ERRORS + 1
28
 
    fi
29
 
    
30
 
    # copy .desktop to /usr/share/applications
31
 
    echo 'Copying .desktop file to: /usr/share/applications/writer.desktop'
32
 
    $SUDO cp ../data/writer.desktop /usr/share/applications/
33
 
    if [ $? -ne 0 ]; then
34
 
        ERRORS=$ERRORS + 1
35
 
    fi
36
 
    
37
 
    if [ $ERRORS -eq 0 ]; then
38
 
        echo
39
 
        echo 'Writer was installed successfully!'
40
 
        echo 'Please log out and back in again to make sure Writer is recognised by the system'
41
 
        echo 'Thanks for trying out Writer!'
42
 
        exit 0
43
 
    else
44
 
        echo
45
 
        echo "$ERRORS errors occurred!"
46
 
        echo 'Writer was NOT installed successfully!'
47
 
        exit 1
48
 
    fi
49
 
    
50
 
else
51
 
    echo
52
 
    echo 'Compilation Failed!'
53
 
    echo 'Cannot install Writer!'
54
 
    exit 1
55
 
fi
 
 
b'\\ No newline at end of file'