mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
permissions fix
This commit is contained in:
@@ -139,11 +139,9 @@ def checkPermissionsOK():
|
||||
def fixPermissions():
|
||||
# Try fixing access rights if needed
|
||||
chmodCommands = []
|
||||
|
||||
if dbR_access == False or dbW_access == False:
|
||||
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', dbPath])
|
||||
if confR_access == False or confW_access == False:
|
||||
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', confPath])
|
||||
|
||||
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', fullDbPath])
|
||||
chmodCommands.append(['sudo', 'chmod', 'a+rw', '-R', fullConfPath])
|
||||
|
||||
for com in chmodCommands:
|
||||
# Execute command
|
||||
@@ -193,9 +191,8 @@ if confR_access == False:
|
||||
if dbR_access == False:
|
||||
initialiseFile(fullDbPath, "/home/pi/pialert/back/pialert.db_bak")
|
||||
|
||||
if dbR_access == False or confR_access == False:
|
||||
if checkPermissionsOK() == False: # second check
|
||||
fixPermissions()
|
||||
# last attempt
|
||||
fixPermissions()
|
||||
|
||||
#===============================================================================
|
||||
# Initialise user defined values
|
||||
@@ -2182,8 +2179,8 @@ def send_notifications ():
|
||||
|
||||
# DEBUG - Write output emails for testing
|
||||
#if True :
|
||||
# write_file (logPath + '/report_output.txt', mail_text)
|
||||
# write_file (logPath + '/report_output.html', mail_html)
|
||||
write_file (logPath + '/report_output.txt', mail_text)
|
||||
write_file (logPath + '/report_output.html', mail_html)
|
||||
|
||||
# Send Mail
|
||||
if json_internet != [] or json_new_devices != [] or json_down_devices != [] or json_events != []:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
version: "3"
|
||||
services:
|
||||
pialert:
|
||||
privileged: true
|
||||
build: .
|
||||
container_name: pialert
|
||||
network_mode: "host"
|
||||
|
||||
@@ -73,7 +73,8 @@ CommitDB();
|
||||
|
||||
// create settings groups
|
||||
$isIn = ' in ';
|
||||
foreach ($groups as $group) {
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
$html = $html.'<div class=" box panel panel-default">
|
||||
<a data-toggle="collapse" data-parent="#accordion_gen" href="#'.$group.'">
|
||||
<div class="panel-heading">
|
||||
@@ -84,8 +85,9 @@ CommitDB();
|
||||
<div class="panel-body">';
|
||||
$isIn = ' '; // open the first panel only by default on page load
|
||||
|
||||
// populate settings for each group id="collapse100" class="panel-collapse collapse"
|
||||
foreach ($settings as $set) {
|
||||
// populate settings for each group
|
||||
foreach ($settings as $set)
|
||||
{
|
||||
if($set["Group"] == $group)
|
||||
{
|
||||
$html = $html.
|
||||
|
||||
Reference in New Issue
Block a user