1 | #!/bin/bash␊ |
2 | ␊ |
3 | echo "==============================================="␊ |
4 | echo "Check Proceed: Can the script continue?"␊ |
5 | echo "***************************************"␊ |
6 | ␊ |
7 | # Receives targetVolume and targetDevice␊ |
8 | # Checks the selected volume is present and the disk␊ |
9 | # is partitioned.␊ |
10 | ␊ |
11 | if [ "$#" -eq 2 ]; then␊ |
12 | ␉targetVolume="$1"␊ |
13 | ␉targetDevice="$2"␊ |
14 | ␉echo "DEBUG: passed argument for targetVolume = $targetVolume"␊ |
15 | ␉echo "DEBUG: passed argument for targetDevice = $targetDevice"␊ |
16 | else␊ |
17 | ␉echo "Error - wrong number of values passed"␊ |
18 | ␉exit 9␊ |
19 | fi␊ |
20 | ␊ |
21 | if [ -z "$targetVolume" ]; then␊ |
22 | ␉echo "Cannot find the volume. Exiting."␊ |
23 | ␉exit 1␊ |
24 | else␊ |
25 | ␉echo "Confirming target volume exists"␊ |
26 | fi␊ |
27 | ␊ |
28 | if [ "$targetDevice" = "$targetDevice#*disk*s" ]; then␊ |
29 | ␉echo "ERROR Volume does not use slices."␊ |
30 | ␉exit 1␉␉␊ |
31 | else␊ |
32 | ␉echo "Confirming target device uses slices"␊ |
33 | fi␊ |
34 | ␊ |
35 | echo "-----------------------------------------------"␊ |
36 | echo ""␊ |
37 | ␊ |
38 | exit 0 |