dotfiles

config files and scripts at HOME.
git clone git://git.ricketyspace.net/dotfiles.git
Log | Files | Refs

commit d4e05850f08c1225cc5bcd99b34221d69bb8eed0
parent 19470acccc943444cfcfd7d113fbd566e538b3e9
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun, 15 Apr 2018 15:03:04 +0000

.bin: Remove create-lo.

Diffstat:
.bin/create-lo | 69---------------------------------------------------------------------
1 file changed, 0 insertions(+), 69 deletions(-)

diff --git a/.bin/create-lo b/.bin/create-lo @@ -1,69 +0,0 @@ -#!/usr/bin/zsh -# -# Copyright (C) 2016 rsiddharth <s@ricketyspace.net> -# -# This program is free software: you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program (see COPYING). If not, see -# <http://www.gnu.org/licenses/>. - -LO_NAME=$1 -LO_FILE_PATH=$2 -LO_SIZE=$3 # in gigs, minimum is 1 gig. - -[[ -z $LO_NAME ]] && - echo 'ERROR: Name for lo device not given!' && - exit 1 - -[[ -z $LO_FILE_PATH ]] && - echo 'ERROR: File path not given!' && - exit 1 - -[[ -z $LO_SIZE ]] && - echo 'ERROR: File size not given!' && - exit 1 - -# create file -echo 'Creating file' $LO_FILE_PATH '(size' $LO_SIZE 'GB)...Might take a while :|' -((LO_SIZE=$LO_SIZE * 100)) && - dd if=/dev/urandom iflag=fullblock of=$LO_FILE_PATH bs=10M count=$LO_SIZE && - - # get a unused loop device. - LO_DEV=$(losetup -f) && - - # map file to loop device. - echo 'Mapping file to loop device...' && - losetup $LO_DEV $LO_FILE_PATH && - - # encrypt device. - echo 'Encrypting loop device...' && - cryptsetup luksFormat $LO_DEV && - - # open the now encrypted device. - echo 'Opening loop device...' && - cryptsetup open $LO_DEV $LO_NAME && - - # format the device. - echo 'Formatting loop device (ext4)...' && - mkfs.ext4 -L $LO_NAME /dev/mapper/$LO_NAME && - echo 'Finished formatting (ext4)...' && - - # close device. - echo 'Closing device...' && - # close loop back device - cryptsetup close $LO_NAME && - - # detach - echo 'Detaching...' && - LO_DEV=$(losetup -n -O name -j $LO_FILE_PATH) && - losetup -d $LO_DEV && - exit 0