Browse Source

v2.3.2

update script
pull/19/head
Aidaho12 7 years ago
parent
commit
d26d949105
  1. 9
      README.md
  2. 7
      app/sql.py
  3. 22
      update.sh

9
README.md

@ -99,6 +99,15 @@ For Runtime API enable state file on HAproxt servers and need install socat on a
```
![alt text](image/haproxy-wi-logs.jpeg "View logs page")
# Update
```
# cd /var/www/haproxy-wi
# chmod +x update.sh
# ./update.sh
```
After update old config saved at /tmp/ folder. Compare new and old config, if in new no changes overwrite the new configuration with the old one, or edit new with your ENV.
# Update DB
```
$ cd /var/www/haproxy-wi/app

7
app/sql.py

@ -539,6 +539,7 @@ if form.getvalue('updategroup') is not None:
update_group(name, descript, id)
if form.getvalue('updateserver') is not None:
import funct
name = form.getvalue('updateserver')
ip = form.getvalue('ip')
group = form.getvalue('servergroup')
@ -551,5 +552,7 @@ if form.getvalue('updateserver') is not None:
print(error_mess)
else:
print('Content-type: text/html\n')
update_server(name, ip, group, typeip, enable, master, id)
if funct.ssh_connect(ip, check=1):
update_server(name, ip, group, typeip, enable, master, id)
else:
print('<span class="alert alert-danger" id="error"><a title="Close" id="errorMess"><b>X</b></a></span>')

22
update.sh

@ -0,0 +1,22 @@
#!/bin/bash
cp app/haproxy-webintarface.config /tmp/
git reset --hard
git pull https://github.com/Aidaho12/haproxy-wi.git
chmod +x app/*py
chown -R apache:apache *
cd app/
./update_db.py
echo ""
echo "#################"
echo "Change in config:"
diff --expand-tabs -W 100 -y /tmp/haproxy-webintarface.config haproxy-webintarface.config |grep "|"
echo ""
echo "Please set your config"
echo ""
echo "################"
echo "Your config saved in /tmp/haproxy-webintarface.config. Please comare with new and set your env back"
echo ""
Loading…
Cancel
Save