github.com/dawnbass68/maddcash@v0.0.0-20201001105353-c91c12cb36e5/build/templates/backend/debian/postinst (about)

     1  {{define "main" -}}
     2  #!/bin/bash
     3  set -e
     4  
     5  case "$1" in
     6  
     7    configure)
     8      if ! id -u {{.Backend.SystemUser}} &> /dev/null
     9      then
    10          useradd --system -M -U {{.Backend.SystemUser}} -s /bin/false
    11      fi
    12  
    13      if [ "$(stat -c '%U' {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend)" != "{{.Backend.SystemUser}}" ]
    14      then
    15          chown -R {{.Backend.SystemUser}}:{{.Backend.SystemUser}} {{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend
    16      fi
    17  
    18  {{if .Backend.PostinstScriptTemplate}}
    19      # generated from postinst_template
    20      {{template "Backend.PostinstScriptTemplate" .}}
    21  {{end}}
    22    ;;
    23  
    24  esac
    25  
    26  #DEBHELPER#
    27  {{end}}