Codebase list python-faraday / d97e378
Update helper-script and faraday.service Sophie Brun 3 years ago
2 changed file(s) with 25 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
55
66 [Service]
77 Type=simple
8 ExecStartPre=/bin/sh -c 'if ! sudo -u postgres -- psql -lqt | cut -d \| -f 1 | grep -qw faraday; then faraday-manage initdb; fi'
98 ExecStart=faraday-server
109
1110 [Install]
00 #!/bin/sh
11
2 aux_file_path="$HOME/.faraday/password_changed.txt"
3 URL="localhost:5985"
2 aux_file_path="/root/.faraday/password_changed.txt"
3 URL="http://localhost:5985"
44
5 systemctl start faraday
5 systemctl start postgresql
6 if sudo [ ! -d /root/.faraday ]; then
7 echo ">>> Setup"
8 sudo faraday-server setup_environment
9 fi
10
11 if ! sudo -u postgres -- psql -lqt | cut -d \| -f 1 | grep -qw faraday; then
12 echo ">>> Init database"
13 sudo faraday-manage initdb
14 fi
15
16 echo ">>> Start faraday.service"
17 sudo systemctl start faraday
618 sleep 3
7 if [ ! -f $aux_file_path ]; then
8 touch $aux_file_path
9 echo "Please, set a new password for the Faraday's default user 'faraday'"
10 faraday-manage change-password
11 xdg-open "${URL}" 2>/dev/null >/dev/null &
12 else
13 xdg-open "${URL}" 2>/dev/null >/dev/null &
19
20 if systemctl is-active --quiet faraday; then
21 if sudo [ ! -f $aux_file_path ]; then
22 sudo touch $aux_file_path
23 echo "Please, set a new password for the Faraday's default user 'faraday'"
24 sudo faraday-manage change-password
25 xdg-open "${URL}" 2>/dev/null >/dev/null &
26 else
27 xdg-open "${URL}" 2>/dev/null >/dev/null &
28 fi
1429 fi
15 systemctl stop faraday