uploading LINUX_MOUNT extension

pull/570/head
drapl0n 2022-12-12 20:57:20 +05:30 committed by GitHub
parent 8dba72cedd
commit 519b453791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
#!/bin/bash
#
# LINUX_MOUNT v1 by @drapl0n
# Auto mounts BashBunny on GNU/Linux systems.
# NOTE: Mount path is stored in variable "lmnt".
# Usage: LINUX_MOUNT - to automatically mount BashBunny.
# LINUX_UMOUNT - to unmount mounted BashBunny.
function LINUX_MOUNT() {
Q DELAY 1000
Q CTRL-ALT t
Q DELAY 1000
Q STRING unset HISTFILE
Q ENTER
Q DELAY 1000
Q STRING disk='$(lsblk -fs | grep BashBunny | awk '\'{print\ '$1'}\'\)''
Q ENTER
Q DELAY 200
Q STRING udisksctl mount -b /dev/'$disk'
Q ENTER
Q DELAY 2000
Q STRING lmnt='$(lsblk | grep $disk | awk '\'{print\ '$7'}\'\)''
Q ENTER
Q DELAY 500
}
function LINUX_UMOUNT() {
Q DELAY 1000
Q STRING udisksctl unmount -b /dev/'$disk'
Q ENTER
Q DELAY 1000
}
export -f LINUX_MOUNT LINUX_UMOUNT