Skip to content

Instantly share code, notes, and snippets.

@shvchk
Created February 22, 2021 22:55
Show Gist options
  • Select an option

  • Save shvchk/847e26458f9fe911b4639dfe04d8c816 to your computer and use it in GitHub Desktop.

Select an option

Save shvchk/847e26458f9fe911b4639dfe04d8c816 to your computer and use it in GitHub Desktop.
#!/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