Improve upgrade logs more

This commit is contained in:
Taylor Helsper 2021-02-14 13:05:23 -06:00
parent 016dd4ac12
commit 3233325376
2 changed files with 14 additions and 2 deletions

View File

@ -46,6 +46,16 @@ def get_product_key():
except:
product_key = "product_key_error"
return product_key
def get_drive_size():
size = "-1"
size = subprocess.check_output("df /mnt/hdd | grep /dev | awk '{print $2}'", shell=True).strip()
size = int(size) / 1000 / 1000
return size
def get_quicksync_enabled():
enabled = 1
if os.path.isfile("/mnt/hdd/mynode/settings/quicksync_disabled"):
enabled = 0
return enabled
# Checkin every 24 hours
def check_in():
@ -56,7 +66,9 @@ def check_in():
"serial": get_device_serial(),
"device_type": get_device_type(),
"version": get_current_version(),
"product_key": product_key
"product_key": product_key,
"drive_size": get_drive_size(),
"quicksync_enabled": get_quicksync_enabled(),
}
# Check for new version

View File

@ -90,7 +90,7 @@ fi
# Run post upgrade script
for i in {1..3}
do
/bin/bash /usr/bin/mynode_post_upgrade.sh > /home/admin/upgrade_logs/reinstall_app_${APP}_post_${i}.txt 2>&1
/bin/bash /usr/bin/mynode_post_upgrade.sh 2>&1 | tee /home/admin/upgrade_logs/reinstall_app_${APP}_post_${i}.txt
RC=$?
if [ "${RC}" -eq "0" ]; then
rm -f $UPGRADE_ERROR_FILE