Test update.

This commit is contained in:
Suikan 2022-05-05 23:20:30 +09:00
parent 4699f87cc7
commit ed48590821
3 changed files with 40 additions and 16 deletions

11
script/test/trial.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
DISK=/dev/sdb
DISKSIZE=$(blockdev --report ${DISK} | awk /${DISK}/'{print $6}')
VOLSIZE=$(lvdisplay --units B /dev/vg_test/anko | awk '/Size/{print $3}')
echo $DISKSIZE
echo $VOLSIZE
echo "scale=3; $VOLSIZE/$DISKSIZE" | bc

22
script/test/testutil.sh → script/test/util_cleanup.sh Normal file → Executable file
View file

@ -1,20 +1,8 @@
#!/bin/bash -u
# *******************************************************************************
# Deactivate all LV in the VG and close LUKS volume
# *******************************************************************************
function util_deactivate_and_close(){
echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"."
vgchange -a n "${VGNAME}"
echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"."
cryptsetup close "${CRYPTPARTNAME}"
cat <<- HEREDOC
...Installation process terminated..
HEREDOC
}
# shellcheck disable=SC1091
# Load configuration parameter
source ./config01.sh
# *******************************************************************************
# Delete the nwe volume if overwrite install, and close all
@ -36,3 +24,5 @@ function util_cleanup(){
fi
}
util_cleanup

View file

@ -0,0 +1,23 @@
#!/bin/bash -u
# shellcheck disable=SC1091
# Load configuration parameter
source ./config01.sh
# *******************************************************************************
# Deactivate all LV in the VG and close LUKS volume
# *******************************************************************************
function util_deactivate_and_close(){
echo "...Deactivating all logical volumes in volume group \"${VGNAME}\"."
vgchange -a n "${VGNAME}"
echo "...Closing LUKS volume \"${CRYPTPARTNAME}\"."
cryptsetup close "${CRYPTPARTNAME}"
cat <<- HEREDOC
...Installation process terminated..
HEREDOC
}
util_deactivate_and_close