Add more function's and alises.
This commit is contained in:
parent
64de56b9fe
commit
cb0e70d04e
2 changed files with 41 additions and 0 deletions
|
@ -126,3 +126,40 @@ mread() {
|
|||
mflag -S $1
|
||||
mseq -f : | mseq -S
|
||||
}
|
||||
|
||||
# Set the profile for mail management
|
||||
mprofile() {
|
||||
profiles=$(find "$HOME"/.config/mblaze -type f -exec basename "{}" \;)
|
||||
currentMaildir=$(grep "^Maildir:" "$HOME"/.mblaze/profile | cut -d: -f 2 | sed 's/ //g')
|
||||
|
||||
[ -z "$1" ] && basename "$(grep -w "$currentMaildir" -l -R "$HOME"/.config/mblaze)" && exit 0
|
||||
[ "$1" = "-l" ] && printf '%s\n' "$profiles" && exit 0
|
||||
|
||||
profile="$1"
|
||||
|
||||
if printf '%s\n' "$profiles" | grep -qw "$profile"; then
|
||||
cp "$HOME"/.config/mblaze/"$profile" "$HOME"/.mblaze/profile
|
||||
else
|
||||
printf '%s\n' "This profile doesn't exist"
|
||||
fi
|
||||
}
|
||||
|
||||
# Mount a luks partition
|
||||
mount-luks() {
|
||||
# get the drive path
|
||||
drive="$1"
|
||||
|
||||
# open the encrypted drive
|
||||
sudo cryptsetup luksOpen $drive luks
|
||||
|
||||
# check if the /mnt/encrypted directory exists if not create it
|
||||
[ -d "/mnt/encrypted/" ] || sudo mkdir -p /mnt/encrypted
|
||||
|
||||
# mount the decrypted drive to /mnt/encrypted/ directory
|
||||
sudo mount /dev/mapper/luks /mnt/encrypted
|
||||
}
|
||||
|
||||
umount-luks() {
|
||||
sudo umount /dev/mapper/luks
|
||||
sudo cryptsetup luksClose luks
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue