SHIN'YA M. > ASSUME ZNC IF UNSET. LINK ~/public_hg TO /srv/hg/$USER. COMMIT;

Signed-off-by: Shin'ya Minazuki <shinyoukai@laidback.moe>
This commit is contained in:
2025-12-01 22:21:14 +09:00
parent 47361914cd
commit 7b19e03627
3 changed files with 49 additions and 1 deletions

33
znc-adduser Normal file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# Script for adding users to ZNC
# Arguments: username hashed-password
user="$1"
password="$2"
show_usage() {
printf "Usage: %s username hashed-password\n" "$0"
}
if [ -z "$user" && -z "$password" ]; then
printf "Not enough arguments\n"
show_usage
exit 1
fi
cat <<EOF >>/usr/pkg/etc/znc/configs/znc.conf
<User $user>
<Pass password>
Method = Argon2id
Hash = $password
</Pass>
Admin = false
Nick = $user
MaxNetworks = 5
MultiClients = true
LoadModule = chansaver
LoadModule = controlpanel
LoadModule = nickserv
</User>
EOF
/usr/sbin/service znc restart