22 lines
589 B
Text
22 lines
589 B
Text
|
#!/bin/bash
|
||
|
|
||
|
set -e
|
||
|
|
||
|
if [[ "$1" == "configure" ]]; then
|
||
|
|
||
|
if ! getent group woodpecker >/dev/null; then
|
||
|
groupadd --system woodpecker
|
||
|
fi
|
||
|
|
||
|
if ! getent passwd woodpecker >/dev/null; then
|
||
|
useradd --system --gid woodpecker --groups docker --home-dir /var/lib/woodpecker --shell /bin/sh woodpecker
|
||
|
fi
|
||
|
|
||
|
chown woodpecker:woodpecker /var/lib/woodpecker /etc/woodpecker /etc/woodpecker/agent.conf
|
||
|
chmod 0750 /var/lib/woodpecker /etc/woodpecker
|
||
|
|
||
|
deb-systemd-helper enable woodpecker-agent.service
|
||
|
deb-systemd-invoke restart woodpecker-agent.service
|
||
|
|
||
|
fi
|