Fold long src lines.
authorMatt Birkholz <matt@birchwood-abbey.net>
Sat, 30 Mar 2024 23:05:02 +0000 (18:05 -0500)
committerMatt Birkholz <matt@birchwood-abbey.net>
Sat, 30 Mar 2024 23:05:02 +0000 (18:05 -0500)
README.org
abbey
roles_t/abbey-cloister/tasks/main.yml
roles_t/abbey-core/files/abbey_pisensors
roles_t/abbey-core/tasks/main.yml

index fc962ff322ef9467c7c5f2635cf9fc334161eb33..e2d6b62ed3ded45717aa388942b00c78f604af37 100644 (file)
@@ -968,8 +968,9 @@ Core itself will benefit from using the package cache.
 - name: Use the local Apt package cache.
   become: yes
   copy:
-    content: |
-      Acquire::http::Proxy "http://apt-cacher.{{ domain_priv }}.:3142";
+    content: >
+      Acquire::http::Proxy
+        "http://apt-cacher.{{ domain_priv }}.:3142";
     dest: /etc/apt/apt.conf.d/01proxy
     mode: u=rw,g=r,o=r
 #+END_SRC
@@ -1048,7 +1049,8 @@ print_help() {
        echo ""
        print_usage
        echo ""
-       echo "This plugin checks hardware status using the lm_sensors package."
+       echo "This plugin checks hardware status using" \
+               "the lm_sensors package."
        echo ""
        support
        exit $STATE_OK
@@ -1056,55 +1058,56 @@ print_help() {
 
 brief_data() {
     echo "$1" | sed -n -E -e '
-  /^temp[0-9]+: +[-+][0-9.]+.?C/ { s/^temp[0-9]+: +([-+][0-9.]+).?C.*/ \1/; H }
+  /^temp[0-9]+: +[-+][0-9.]+.?C/ {
+    s/^temp[0-9]+: +([-+][0-9.]+).?C.*/ \1/; H }
   $ { x; s/\n//g; p }'
 }
 
 case "$1" in
-       --help)
-               print_help
-               exit $STATE_OK
-               ;;
-       -h)
-               print_help
-               exit $STATE_OK
-               ;;
-       --version)
-               print_revision $PROGNAME $REVISION
-               exit $STATE_OK
-               ;;
-       -V)
-               print_revision $PROGNAME $REVISION
-               exit $STATE_OK
-               ;;
-       *)
-               sensordata=`sensors 2>&1`
-               status=$?
-               if test ${status} -eq 127; then
-                       text="SENSORS UNKNOWN - command not found"
-                       text="$text (did you install lmsensors?)"
-                       exit=$STATE_UNKNOWN
-               elif test ${status} -ne 0; then
-                       text="WARNING - sensors returned state $status"
-                       exit=$STATE_WARNING
-               elif echo ${sensordata} | egrep ALARM > /dev/null; then
-                       text="SENSOR CRITICAL -`brief_data "${sensordata}"`"
-                       exit=$STATE_CRITICAL
-               elif echo ${sensordata} | egrep FAULT > /dev/null \
-                   && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
-                       text="SENSOR UNKNOWN - Sensor reported fault"
-                       exit=$STATE_UNKNOWN
-               else
-                       text="SENSORS OK -`brief_data "${sensordata}"`"
-                       exit=$STATE_OK
-               fi
-
-               echo "$text"
-               if test "$1" = "-v" -o "$1" = "--verbose"; then
-                       echo ${sensordata}
-               fi
-               exit $exit
-               ;;
+--help)
+       print_help
+       exit $STATE_OK
+       ;;
+-h)
+       print_help
+       exit $STATE_OK
+       ;;
+--version)
+       print_revision $PROGNAME $REVISION
+       exit $STATE_OK
+       ;;
+-V)
+       print_revision $PROGNAME $REVISION
+       exit $STATE_OK
+       ;;
+*)
+       sensordata=`sensors 2>&1`
+       status=$?
+       if test ${status} -eq 127; then
+               text="SENSORS UNKNOWN - command not found"
+               text="$text (did you install lmsensors?)"
+               exit=$STATE_UNKNOWN
+       elif test ${status} -ne 0; then
+               text="WARNING - sensors returned state $status"
+               exit=$STATE_WARNING
+       elif echo ${sensordata} | egrep ALARM > /dev/null; then
+               text="SENSOR CRITICAL -`brief_data "${sensordata}"`"
+               exit=$STATE_CRITICAL
+       elif echo ${sensordata} | egrep FAULT > /dev/null \
+           && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
+               text="SENSOR UNKNOWN - Sensor reported fault"
+               exit=$STATE_UNKNOWN
+       else
+               text="SENSORS OK -`brief_data "${sensordata}"`"
+               exit=$STATE_OK
+       fi
+
+       echo "$text"
+       if test "$1" = "-v" -o "$1" = "--verbose"; then
+               echo ${sensordata}
+       fi
+       exit $exit
+       ;;
 esac
 #+END_SRC
 
@@ -1540,8 +1543,9 @@ while.
 - name: Use the local Apt package cache.
   become: yes
   copy:
-    content: |
-     Acquire::http::Proxy "http://apt-cacher.{{ domain_priv }}.:3142";
+    content: >
+      Acquire::http::Proxy
+        "http://apt-cacher.{{ domain_priv }}.:3142";
     dest: /etc/apt/apt.conf.d/01proxy
     mode: u=rw,g=r,o=r
 #+END_SRC
@@ -2792,7 +2796,8 @@ creates =~/.xmltv/tv_grab_zz_sdjson.conf=, which is copied to
 Afterwards any re-configuration should use the following command.
 
 #+BEGIN_SRC sh
-tv_grab_zz_sdjson --configure --config-file ~/.mythtv/Mr.Antenna.xmltv
+tv_grab_zz_sdjson --configure \
+       --config-file ~/.mythtv/Mr.Antenna.xmltv
 #+END_SRC
 
 Here is a transcript of a session with ~tv_grab_zz_sdjson~.  Note that
@@ -3044,7 +3049,8 @@ Direct account.  The administrator then runs the ~tv_grab_zz_sdjson~
 program as user ~mythtv~.
 
 #+BEGIN_SRC sh
-tv_grab_zz_sdjson --configure --config-file ~/.mythtv/Mr.Antenna.xmltv
+tv_grab_zz_sdjson --configure \
+       --config-file ~/.mythtv/Mr.Antenna.xmltv
 #+END_SRC
 
 The program will prompt for the zip code and offer a list of "inputs"
@@ -3483,8 +3489,8 @@ if ($ARGV[0] eq "tz") {
 
 #+CAPTION: =abbey=
 #+BEGIN_SRC perl :tangle abbey
-die
-  "usage: $0 [config,new,old,pass,client,upgrade,reboots,versions]\n";
+my $ops = "config,new,old,pass,client,upgrade,reboots,versions";
+die "usage: $0 [$ops]\n";
 #+END_SRC
 
 
diff --git a/abbey b/abbey
index 9f8ec93727fdd5acb3aa3c688c36911025a1e78d..779eab4f1cb05710843f9140a2a45641186a6dc5 100755 (executable)
--- a/abbey
+++ b/abbey
@@ -44,5 +44,5 @@ if ($ARGV[0] eq "tz") {
        "playbooks/timezone.yml");
 }
 
-die
-  "usage: $0 [config,new,old,pass,client,upgrade,reboots,versions]\n";
+my $ops = "config,new,old,pass,client,upgrade,reboots,versions";
+die "usage: $0 [$ops]\n";
index f326a8b1b72443dba1bc1bad900abdc3a2afd45d..db8c390584e73626209e73876c8411adbdd01424 100644 (file)
@@ -2,8 +2,9 @@
 - name: Use the local Apt package cache.
   become: yes
   copy:
-    content: |
-     Acquire::http::Proxy "http://apt-cacher.{{ domain_priv }}.:3142";
+    content: >
+      Acquire::http::Proxy
+        "http://apt-cacher.{{ domain_priv }}.:3142";
     dest: /etc/apt/apt.conf.d/01proxy
     mode: u=rw,g=r,o=r
 
index 1901f5e1e58aad296aacd70c8130139adced20ef..6fcb78784ed3fafc23234d8a16a4bf0d818173cf 100644 (file)
@@ -16,7 +16,8 @@ print_help() {
        echo ""
        print_usage
        echo ""
-       echo "This plugin checks hardware status using the lm_sensors package."
+       echo "This plugin checks hardware status using" \
+               "the lm_sensors package."
        echo ""
        support
        exit $STATE_OK
@@ -24,53 +25,54 @@ print_help() {
 
 brief_data() {
     echo "$1" | sed -n -E -e '
-  /^temp[0-9]+: +[-+][0-9.]+.?C/ { s/^temp[0-9]+: +([-+][0-9.]+).?C.*/ \1/; H }
+  /^temp[0-9]+: +[-+][0-9.]+.?C/ {
+    s/^temp[0-9]+: +([-+][0-9.]+).?C.*/ \1/; H }
   $ { x; s/\n//g; p }'
 }
 
 case "$1" in
-       --help)
-               print_help
-               exit $STATE_OK
-               ;;
-       -h)
-               print_help
-               exit $STATE_OK
-               ;;
-       --version)
-               print_revision $PROGNAME $REVISION
-               exit $STATE_OK
-               ;;
-       -V)
-               print_revision $PROGNAME $REVISION
-               exit $STATE_OK
-               ;;
-       *)
-               sensordata=`sensors 2>&1`
-               status=$?
-               if test ${status} -eq 127; then
-                       text="SENSORS UNKNOWN - command not found"
-                       text="$text (did you install lmsensors?)"
-                       exit=$STATE_UNKNOWN
-               elif test ${status} -ne 0; then
-                       text="WARNING - sensors returned state $status"
-                       exit=$STATE_WARNING
-               elif echo ${sensordata} | egrep ALARM > /dev/null; then
-                       text="SENSOR CRITICAL -`brief_data "${sensordata}"`"
-                       exit=$STATE_CRITICAL
-               elif echo ${sensordata} | egrep FAULT > /dev/null \
-                   && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
-                       text="SENSOR UNKNOWN - Sensor reported fault"
-                       exit=$STATE_UNKNOWN
-               else
-                       text="SENSORS OK -`brief_data "${sensordata}"`"
-                       exit=$STATE_OK
-               fi
+--help)
+       print_help
+       exit $STATE_OK
+       ;;
+-h)
+       print_help
+       exit $STATE_OK
+       ;;
+--version)
+       print_revision $PROGNAME $REVISION
+       exit $STATE_OK
+       ;;
+-V)
+       print_revision $PROGNAME $REVISION
+       exit $STATE_OK
+       ;;
+*)
+       sensordata=`sensors 2>&1`
+       status=$?
+       if test ${status} -eq 127; then
+               text="SENSORS UNKNOWN - command not found"
+               text="$text (did you install lmsensors?)"
+               exit=$STATE_UNKNOWN
+       elif test ${status} -ne 0; then
+               text="WARNING - sensors returned state $status"
+               exit=$STATE_WARNING
+       elif echo ${sensordata} | egrep ALARM > /dev/null; then
+               text="SENSOR CRITICAL -`brief_data "${sensordata}"`"
+               exit=$STATE_CRITICAL
+       elif echo ${sensordata} | egrep FAULT > /dev/null \
+           && test "$1" != "-i" -a "$1" != "--ignore-fault"; then
+               text="SENSOR UNKNOWN - Sensor reported fault"
+               exit=$STATE_UNKNOWN
+       else
+               text="SENSORS OK -`brief_data "${sensordata}"`"
+               exit=$STATE_OK
+       fi
 
-               echo "$text"
-               if test "$1" = "-v" -o "$1" = "--verbose"; then
-                       echo ${sensordata}
-               fi
-               exit $exit
-               ;;
+       echo "$text"
+       if test "$1" = "-v" -o "$1" = "--verbose"; then
+               echo ${sensordata}
+       fi
+       exit $exit
+       ;;
 esac
index a624ee44ae2482dca2f60abd82ec56d521f6528e..52d7a3ef4c68814f04a1b94ce3d899604f02e87d 100644 (file)
 - name: Use the local Apt package cache.
   become: yes
   copy:
-    content: |
-      Acquire::http::Proxy "http://apt-cacher.{{ domain_priv }}.:3142";
+    content: >
+      Acquire::http::Proxy
+        "http://apt-cacher.{{ domain_priv }}.:3142";
     dest: /etc/apt/apt.conf.d/01proxy
     mode: u=rw,g=r,o=r