22 lines
582 B
Text
22 lines
582 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 /var/lib/woodpecker/data
|
||
|
chmod 0750 /var/lib/woodpecker /var/lib/woodpecker/data
|
||
|
|
||
|
deb-systemd-helper enable woodpecker-server.service
|
||
|
deb-systemd-invoke restart woodpecker-server.service
|
||
|
|
||
|
fi
|