Skip to content

Commit

Permalink
chore:Add user and group for xmidt-agent, as well as set the service …
Browse files Browse the repository at this point in the history
…to preset (enabled).
  • Loading branch information
schmidtw committed Jul 24, 2024
1 parent 15db6be commit 9abdaa8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ nfpms:
- src: .release/ipk/config.yml
dst: /etc/xmidt-agent/01-config.yml

scripts:
preinstall: .release/ipk/preinstall.sh
postinstall: .release/ipk/postinstall.sh

ipk:
fields:
Bugs: https://github.com/xmidt-org/xmidt-agent/issues

-
id: openwrt
file_name_template: '{{ .PackageName }}_{{ .Version }}_openwrt_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
Expand Down
5 changes: 5 additions & 0 deletions .release/ipk/postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# SPDX-FileCopyrightText: 2024 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0

systemctl preset xmidt-agent.service >/dev/null 2>&1
13 changes: 13 additions & 0 deletions .release/ipk/preinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# SPDX-FileCopyrightText: 2024 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0

getent group xmidt-agent > /dev/null || groupadd -r xmidt-agent
getent passwd xmidt-agent > /dev/null || \
useradd \
-d /var/run/xmidt-agent \
-r \
-g xmidt-agent \
-s /sbin/nologin \
-c "Xmidt-Agent Client" \
xmidt-agent

0 comments on commit 9abdaa8

Please sign in to comment.