Add copyparty config

This commit is contained in:
Ceres 2025-10-14 17:02:31 +01:00
parent 63eb5d9df4
commit 94c9e3b396

View file

@ -112,6 +112,31 @@ if [ "$dokey" = 'y' ]; then
chown -R "$name:$name" "/home/$name"
fi
mkdir -p "/home/$name/cp/public"
mkdir "/home/$name/cp/priv"
copypass=$(echo $RANDOM | md5sum | head -c 10)
echo "The users copyparty password is $copypass"
sed -i "/account/a \ $name: $copypass" test.conf
cat <<EOF >> test.conf
[/$name]
/home/$name/cp/public
accs:
r: *
rw: $name
[/.$name]
/home/$name/cp/priv
accs:
rw: $name
EOF
#set user home dir ownership as last check
chown -R "$name:$name" "/home/$name"
echo
echo
echo -e '\e[31mUSER CREATED!\e[m (hopefully)'