24 lines
596 B
Bash
24 lines
596 B
Bash
#!/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
|