library WIP

This commit is contained in:
l0sted 2018-09-12 00:09:09 +03:00
parent e9c54e81d0
commit f3455980be

24
lib.sh Normal file
View File

@ -0,0 +1,24 @@
partition() {
lsblk -o NAME,LABEL,FSTYPE,SIZE,MOUNTPOINT,MODEL
until [ ! -f $targetDrive ]
do
read -p "Target drive is " targetDrive
targetDrive=/dev/$targetDrive
done
echo "Encrypted?"
while read -r -n 1 -s answer ; do
if [[ $answer = [YyNn] ]]; then
[[ $answer = [Yy] ]] && encryptedDevice=true && echo "WARNING You will be asked for password later" #read -p "Password: " encryptedPassword
[[ $answer = [Nn] ]] && encryptedDevice=false
break
fi
done
#get swap size
swapSize=$(free -m | grep "Mem" | awk '{print $2}')
read -p "Enter extra amount of swap (empty == 512):" swapExtra
if [ -z "$swapExtra" ] && swapExtra=512
let "swapSize += swapExtra" #add 512 mbs to swap for
swapSize=$swapSize"M"
return $TRUE
}