diff options
Diffstat (limited to 'dict-freedict-eng-fra.install')
-rw-r--r-- | dict-freedict-eng-fra.install | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/dict-freedict-eng-fra.install b/dict-freedict-eng-fra.install index d017c18b26ab..7d852f8c7c85 100644 --- a/dict-freedict-eng-fra.install +++ b/dict-freedict-eng-fra.install @@ -1,10 +1,12 @@ +# Generated by aur-fd-scripts - https://git.respiranto.de/aur-fd-scripts.git/ + basename=eng-fra -pkgname=dict-freedict-$basename +pkgname="dict-freedict-${basename}" dictd_conf=/etc/dict/dictd.conf datadir=/usr/share/dictd -conf="database $basename { - data $datadir/$basename.dict.dz - index $datadir/$basename.index +conf="database ${basename} { + data ${datadir}/${basename}.dict.dz + index ${datadir}/${basename}.index }" post_install() @@ -12,12 +14,12 @@ post_install() echo if pacman -Qq dictd > /dev/null 2>&1 then - if grep -q "^database *$basename" "$dictd_conf" + if grep -q "^database *${basename}" "${dictd_conf}" then - echo "$pkgname already configured in $dictd_conf" + echo "${pkgname} already configured in ${dictd_conf}" else - echo "Adding configuration for $pkgname to $dictd_conf" - echo "$conf" >> "$dictd_conf" + echo "Adding configuration for ${pkgname} to ${dictd_conf}" + echo "${conf}" >> "${dictd_conf}" fi if systemctl -q is-active dictd.service @@ -54,17 +56,17 @@ post_remove() { if pacman -Qq dictd > /dev/null 2>&1 then - current_conf="$(grep -A 3 "^database *$basename" "$dictd_conf")" - if test -n "$current_conf" + current_conf="$(grep -A 3 "^database *${basename}" "${dictd_conf}")" + if test -n "${current_conf}" then echo - if test "$current_conf" = "$conf" + if test "${current_conf}" = "${conf}" then - echo "Removing configuration for $pkgname from $dictd_conf" - sed -i "/database $basename {/,/}/d" "$dictd_conf" + echo "Removing configuration for ${pkgname} from ${dictd_conf}" + sed -i "/database ${basename} {/,/}/d" "${dictd_conf}" else echo "User created / modified configuration" \ - "for $pkgname in $dictd_conf is left untouched." + "for ${pkgname} in ${dictd_conf} is left untouched." fi fi |