stable-diffusion-ui-podman/init

20 lines
489 B
Plaintext
Raw Normal View History

#!/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'