stable-diffusion-ui-podman/init
fbt 1a54b137c3 init
Signed-off-by: fbt <fbt@fleshless.org>
2023-10-23 01:42:57 +00:00

20 lines
489 B
Bash
Executable File

#!/usr/bin/env bash
pkg="/stable-diffusion-ui.pkg.tar.zst"
cfg="/opt/stable-diffusion-ui/config.yaml"
if [[ -f "$pkg" ]]; then
pacman -U --noconfirm --overwrite '/opt/stable-diffusion-ui/*' "$pkg"
if ! [[ -f "$cfg" ]]; then
mv /config.yaml "$cfg" || {
printf 'Failed to move the default config file to %s!\n' "$cfg"
}
fi
chown -R stable-diffusion:stable-diffusion /opt/stable-diffusion-ui
rm -vf "$pkg"
fi
exec su stable-diffusion -c '/usr/bin/stable-diffusion-ui-server'