Skip to content

Instantly share code, notes, and snippets.

@iapyeh
Last active January 14, 2021 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iapyeh/7c17b8b7684557f495bd50952586f34f to your computer and use it in GitHub Desktop.
Save iapyeh/7c17b8b7684557f495bd50952586f34f to your computer and use it in GitHub Desktop.
getting password and switching between debug mode and productive mode
#!/bin/bash
# getdatafromemail.py read password by password = sys.stdin.read()
if [ -z "$1" ] || [ "productive" != "$1" ]; then
# run by "run.getdatafromemail.sh" or "run.getdatafromemail.sh whatever_except_productive"
password=PASSWORD
echo "----debugging mode----"
if [ $password = "PASSWORD" ]; then
echo "entr password to receive email"
read -s password
else
echo $password | python3 getdatafromemail.py
fi
else
# run by "run.getdatafromemail.sh productive"
echo "----productive mode----"
echo "entr password to receive email"
read -s password
echo $password | nohup python3 getdatafromemail.py > /tmp/log.getdatafromemail.txt 2>&1 &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment