move all bash script function to main.py