@@ -25,6 +25,9 @@ LastCheckNetworkInformation=$(date +%s)
25
25
# padd_data holds the data returned by FTL's /padd endpoint globally
26
26
padd_data=" "
27
27
28
+ # should PADD run only once?
29
+ runOnce=false
30
+
28
31
# COLORS
29
32
CSI=" $( printf ' \033' ) [" # Control Sequence Introducer
30
33
red_text=" ${CSI} 91m" # Red
@@ -1710,12 +1713,15 @@ StartupRoutine(){
1710
1713
fi
1711
1714
fi
1712
1715
1713
- moveXOffset; printf " %s" " - Starting in "
1714
- for i in 3 2 1
1715
- do
1716
- printf " %s..." " $i "
1717
- sleep 1
1718
- done
1716
+ if [ " ${runOnce} " = " false" ]; then
1717
+ moveXOffset; printf " %s" " - Starting in "
1718
+ for i in 3 2 1
1719
+ do
1720
+ printf " %s..." " $i "
1721
+ sleep 1
1722
+ done
1723
+ fi
1724
+
1719
1725
}
1720
1726
1721
1727
NormalPADD () {
@@ -1739,6 +1745,11 @@ NormalPADD() {
1739
1745
# Output everything to the screen
1740
1746
PrintDashboard ${padd_size}
1741
1747
1748
+ # Should we only run once?
1749
+ if [ " ${runOnce} " = " true" ]; then
1750
+ break
1751
+ fi
1752
+
1742
1753
# Sleep for 5 seconds
1743
1754
# sending sleep in the background and wait for it
1744
1755
# this way the TerminalResize trap can kill the sleep
@@ -1842,6 +1853,7 @@ DisplayHelp() {
1842
1853
::: --server <DOMAIN|IP> domain or IP of your Pi-hole (default: localhost)
1843
1854
::: --secret <password> your Pi-hole's password, required to access the API
1844
1855
::: --2fa <2fa> your Pi-hole's 2FA code, if 2FA is enabled
1856
+ ::: --runonce display output once and exit
1845
1857
::: -u, --update update to the latest version
1846
1858
::: -v, --version show PADD version info
1847
1859
::: -h, --help display this help text
@@ -1939,6 +1951,7 @@ while [ "$#" -gt 0 ]; do
1939
1951
" -u" | " --update" ) xOffset=0; doUpdate=true;;
1940
1952
" -h" | " --help" ) DisplayHelp; exit 0;;
1941
1953
" -v" | " --version" ) xOffset=0; versionOnly=true ;;
1954
+ " --runonce" ) runOnce=true;;
1942
1955
" --xoff" ) xOffset=" $2 " ; xOffOrig=" $2 " ; shift ;;
1943
1956
" --yoff" ) yOffset=" $2 " ; yOffOrig=" $2 " ; shift ;;
1944
1957
" --server" ) SERVER=" $2 " ; shift ;;
0 commit comments