File: functions.yml

package info (click to toggle)
boxer-data 6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,008 kB
  • ctags: 5
  • sloc: makefile: 21
file content (26 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
classes:
  - Admin
parameters:
  doc:
    admin:
      tweak:
        - define routines to make backup of and help edit config files
  tweak:
    - >
      _backup(){ set -e;\
        if [ -e "$1.orig" ]; then \
          :;\
        elif [ -e "$1" ]; then \
          cp -a "$1" "$1.orig";\
        else \
          touch "$1.orig";\
        fi; }
    - >
      _clone(){ set -e;\
        _backup "$2";\
        cp -a "$1" "$2"; }
    - >
      _setvar(){ set -e;\
        _backup "$1";\
        sed -i -r \
          -e "s,^#?($2)=.*,\\1=$3," "$1"; }