diff --git a/awk b/awk new file mode 100644 index 0000000..e69de29 diff --git a/awk1 b/awk1 new file mode 100644 index 0000000..67ccf5a --- /dev/null +++ b/awk1 @@ -0,0 +1,2 @@ +pwrstat -status | awk '{ print "12345," $0; }' > ups + diff --git a/script b/script new file mode 100755 index 0000000..1774b47 --- /dev/null +++ b/script @@ -0,0 +1,48 @@ +#Should do something like + +cat myfile |while read file +do +echo $file |awk '/State/' myfile >> > awk +done + +cat myfile |while read file +do +echo $file |awk '/Utility Voltage/' myfile >> > awk +done + +cat myfile |while read file +do +echo $file |awk '/Battery Capacity/' myfile >> > awk +done + +cat myfile |while read file +do +echo $file |awk '/Remaining Runtime/' myfile >> > awk +done + +cat myfile |while read file +do +echo $file |awk '/Load/' myfile >> > awk +done + +cat myfile |while read file +do +echo $file |awk '/Line Interaction/' myfile >> > awk +done + +cat myfile |while read file +do +echo $file |awk '/Test Result/' myfile >> > awk +done + +cat myfile |while read file +do +echo $file |awk '/Last Power Event/' myfile >> > awk +done + + + + + + + diff --git a/script1.sh b/script1.sh new file mode 100755 index 0000000..05443d8 --- /dev/null +++ b/script1.sh @@ -0,0 +1,3 @@ +pwrstat -status | grep -E 'State|Power Supply by|Utility Voltage|Output Voltage|Battery Capacity|Remaining Runtime|Load|Line Interaction|Test Result|Last Power Event' > ups + + diff --git a/ups b/ups new file mode 100644 index 0000000..35ee880 --- /dev/null +++ b/ups @@ -0,0 +1,20 @@ +12345, +12345,The UPS information shows as following: +12345, +12345, Properties: +12345, Model Name................... Value2200E +12345, Rating Voltage............... 230 V +12345, Rating Power................. 1320 Watt(2200 VA) +12345, +12345, Current UPS status: +12345, State........................ Normal +12345, Power Supply by.............. Utility Power +12345, Utility Voltage.............. 235 V +12345, Output Voltage............... 235 V +12345, Battery Capacity............. 100 % +12345, Remaining Runtime............ 100 min. +12345, Load......................... 0 Watt(0 %) +12345, Line Interaction............. None +12345, Test Result.................. Unknown +12345, Last Power Event............. Blackout at 2019/07/23 10:14:07 for 72 min. +12345,