dotwryn/zsh/google

20 lines
451 B
Plaintext
Raw Normal View History

2020-11-04 19:57:36 +00:00
#!/bin/zsh
alias gdrive="RCLONE_GOOGLE_DRIVE_MOUNT"
RCLONE_GOOGLE_DRIVE_MOUNT() {
local RCLONE_REMOTE_NAME='google-drive';
2020-11-10 23:14:06 +00:00
local MOUNT_POINT="$HOME/GoogleDrive";
[ -d $MOUNT_POINT ] \
&& { echo "connection already active at '$MOUNT_POINT'"; return 1; }
2020-11-04 19:57:36 +00:00
clear;
figlet GOOGLE DRIVE CONNECTION | lolcat;
echo -e "\e[3m(C-c to close)\e[0m";
2020-11-10 23:14:06 +00:00
mkdir $MOUNT_POINT
2020-11-04 19:57:36 +00:00
rclone mount "$RCLONE_REMOTE_NAME:$1" "$HOME/GoogleDrive"
2020-11-10 23:14:06 +00:00
rmdir $MOUNT_POINT
2020-11-04 19:57:36 +00:00
}