forked from pomkos/payme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·46 lines (38 loc) · 1.01 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
source "$HOME"/miniconda3/bin/activate
echo "What would you like to do?"
echo "[1] Install payme"
echo "[2] Add to crontab"
echo
read input
function edit_cron() {
crontab -l >file
echo "# start after each reboot" >>file
echo "@reboot $HOME/projects/payme/start_me.sh > $HOME/projects/payme/start_me.log 2>&1" >>file
crontab file
rm file
echo "payme will start every reboot"
}
function install_payme() {
conda create -y --name "payme_env"
conda activate payme_env
conda install -y -c conda-forge python=3.8
cd $HOME/projects/payme
pip install --no-input -r requirements.txt
nohup streamlit run apps/main.py --server.port 8501 &
conda deactivate
read cron "Append payme to crontab? [y/n] "
echo
if [[ $cron == "Y" || $cron == "y" ]]; then
edit_cron
fi
echo "payme installed on port 8501"
}
if [[ $input == 1 ]]; then
install_payme
elif [[ $input == 2 ]]; then
edit_cron
else
echo "No option selected"
exit 1
fi