Created
February 22, 2021 22:55
-
-
Save shvchk/847e26458f9fe911b4639dfe04d8c816 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/echo Source this file don't run it | |
| echo "Password:" | |
| read -s RCLONE_CONFIG_PASS | |
| export RCLONE_CONFIG_PASS | |
| if [ -n $RCLONE_PASS_TIMEOUT ]; then | |
| pid=$$ | |
| trap 'unset RCLONE_CONFIG_PASS' SIGALRM | |
| ( ( sleep $RCLONE_PASS_TIMEOUT ; kill -ALRM $pid ) & ) | |
| echo -n "Password will be remembered in this session for $RCLONE_PASS_TIMEOUT" | |
| [[ $RCLONE_PASS_TIMEOUT =~ [smhd] ]] && echo || echo " seconds" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment