v1.0.0
===================================================================== Finally decided to port personal scripts into a standalone library. --- Release Notes ------------------------ - added support for python, zsh, and zx scripts - added support for "interactive" scripts which drop the user to a REPL - added support for passing arguments to commands - added support for python/node virtualenv management through scwrypts - added contributing and usage docs - updated zsh plugin to write commands to history - licensed under GPLv3 --- New Scripts -------------------------- zsh/scwrypts ) - configure - environment/copy - environment/delete - environment/edit - environment/synchronize - logs/clear - logs/view zsh ) - aws/ecr/login - aws/efs/mount - aws/efs/unmount - aws/route53/backup - aws/s3/media-sync/pull - aws/s3/media-sync/push python ) - redis/interactive
This commit is contained in:
33
zsh/aws/efs/unmount
Executable file
33
zsh/aws/efs/unmount
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/zsh
|
||||
source ${0:a:h}/common.zsh
|
||||
__CHECK_IMPORTS
|
||||
#####################################################################
|
||||
|
||||
_EFS_DISCONNECT() {
|
||||
[ ! -d "$AWS__EFS__LOCAL_MOUNT_POINT" ] && {
|
||||
__STATUS 'no efs currently mounted'
|
||||
exit 0
|
||||
}
|
||||
|
||||
local MOUNTED=$(ls "$AWS__EFS__LOCAL_MOUNT_POINT")
|
||||
[ ! $MOUNTED ] && {
|
||||
__STATUS 'no efs currently mounted'
|
||||
exit 0
|
||||
}
|
||||
|
||||
__GETSUDO || exit 1
|
||||
|
||||
|
||||
local SELECTED=$(echo $MOUNTED | __FZF 'select a file system to unmount')
|
||||
[ ! $SELECTED ] && __ABORT
|
||||
|
||||
local EFS="$AWS__EFS__LOCAL_MOUNT_POINT/$SELECTED"
|
||||
__STATUS "unmounting '$SELECTED'"
|
||||
sudo umount $EFS >/dev/null 2>&1
|
||||
sudo rmdir $EFS \
|
||||
&& __SUCCESS "done" \
|
||||
|| __FAIL 2 "failed to unmount '$EFS'"
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
_EFS_DISCONNECT
|
Reference in New Issue
Block a user