I have an app-factory styled web-app running and I want to access it daily to check for expired database entries. There are functions within the program to do this, but I have not been able to access them unless I manually start a flask shell from the environment console. I tried running the following script but it hangs after the call to flask shell.
#!/bin/bash
source virtualenvwrapper.sh;
workon /VENV;
flask --app PROJECT shell;
import PROJECT.main.utils.check_expired;
check_expired();
quit();
deactivate;
[edit by admin: formatting]