|
@@ -220,9 +220,16 @@ def ffpb_peerinfo(bot, trigger):
|
|
|
info_uptime = ""
|
|
|
if "statistics" in node and "uptime" in node["statistics"]:
|
|
|
u = int(float(node["statistics"]["uptime"]))
|
|
|
- h, r = divmod(int(float(node["statistics"]["uptime"])), 3600)
|
|
|
- m, s = divmod(r, 60)
|
|
|
- info_uptime = ' up {0}h {1}m'.format(h,m) if h > 0 else ' up {0}m'.format(m)
|
|
|
+
|
|
|
+ d, r1 = divmod(int(float(node["statistics"]["uptime"])), 86400)
|
|
|
+ h, r2 = divmod(r1, 3600)
|
|
|
+ m, s = divmod(r2, 60)
|
|
|
+ if d > 0:
|
|
|
+ info_uptime = ' up {0}d {1}h'.format(d,h)
|
|
|
+ elif h > 0:
|
|
|
+ info_uptime = ' up {0}h {1}m'.format(h,m)
|
|
|
+ else:
|
|
|
+ info_uptime = ' up {0}m'.format(m)
|
|
|
|
|
|
bot.say('[{0}] {1}{2}{3}{4}{5}'.format(info_mac, info_name, info_hw, info_fw, info_update, info_uptime))
|
|
|
|