summaryrefslogtreecommitdiffstats
path: root/plugins/plugin_examples/sample3Plugin/plugin
blob: ba3a5e3e93514708177bc19c2bad7694b1050d04 (plain)
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
#!/bin/bash

# Since this is just an example this will only have default tasks.
TASK=""

use()
{
    echo You are using it wrong.
}

if [ $1 ] ; then
    if [ $2 ] ;then
        TASK=$2
    else
        use
        exit 1
    fi
else
    use
    exit 1
fi


if [ $TASK = "prepare" ]; then
    echo prepare true
fi
if [ $TASK = "diagnose" ]; then
    echo diagnose false
fi
if [ $TASK = "clean" ]; then
    echo clean true
fi
if [ $TASK = "fix" ]; then
    echo fix true
fi
if [ $TASK = "backup" ]; then
    echo backup true
fi
if [ $TASK = "restore" ]; then
    echo restore true
fi