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 | fi␊ |
17 | ␊ |
18 | if [ -z "$targetVolume" ]; then␊ |
19 | ␉echo "Cannot find the volume. Exiting."␊ |
20 | ␉exit 1␊ |
21 | else␊ |
22 | ␉echo "Confirming target volume exists"␊ |
23 | fi␊ |
24 | ␊ |
25 | if [ "$targetDevice" = "$targetDevice#*disk*s" ]; then␊ |
26 | ␉echo "ERROR Volume does not use slices."␊ |
27 | ␉exit 1␉␉␊ |
28 | else␊ |
29 | ␉echo "Confirming target device uses slices"␊ |
30 | fi␊ |
31 | ␊ |
32 | echo "-----------------------------------------------"␊ |
33 | echo ""␊ |
34 | ␊ |
35 | exit 0 |