ptrcports/ptrcbuild-base/ptrcbuild-base.post-install

25 lines
596 B
Text
Raw Permalink Normal View History

2022-07-22 23:36:52 +00:00
#!/bin/sh
adduser -D nyan
adduser nyan wheel
key_location="$(SUDO="" abuild-keygen -in -b 4096 2>&1 | grep Installing | cut -d" " -f3)"
key_location="${key_location/.pub/}"
password="$(openssl rand -hex 6)"
echo "nyan:$password" | chpasswd
mkdir -p /home/nyan/.abuild
echo "PACKAGER_PRIVKEY=/home/nyan/.abuild/nyan.rsa" > /home/nyan/.abuild/abuild.conf
mv "$key_location" /home/nyan/.abuild/nyan.rsa
mv "$key_location".pub /home/nyan/.abuild/nyan.rsa.pub
cp /home/nyan/.abuild/nyan.rsa.pub /etc/apk/keys
chown -R nyan:nyan /home/nyan/.abuild
cat 1>&2 <<EOF
The password is: $password
EOF