This commit is contained in:
Bob Mottram 2016-10-28 16:24:03 +01:00
parent d5dfc82c24
commit 98523bc0b1
1 changed files with 30 additions and 30 deletions

View File

@ -63,9 +63,9 @@ function stop_irc_bouncer {
function remove_user_irc_bouncer {
remove_username="$1"
if [ -f /home/znc/.znc/config/znc.conf ]; then
if [ -f /home/znc/.znc/configs/znc.conf ]; then
stop_irc_bouncer
sed -i "/<User ${remove_username}>/,/</User>/d" /home/znc/.znc/config/znc.conf
sed -i "/<User ${remove_username}>/,/</User>/d" /home/znc/.znc/configs/znc.conf
start_irc_bouncer
fi
}
@ -106,34 +106,34 @@ function add_user_irc_bouncer {
new_user_hash=$(echo "${new_user_password}${new_user_salt}" | sha256sum)
new_user_pass="sha256#${new_user_hash}#${new_user_salt}#"
echo "<User ${new_username}>" >> /home/znc/.znc/config/znc.conf
echo " Pass = ${new_user_pass}" >> /home/znc/.znc/config/znc.conf
echo " Admin = ${is_admin}" >> /home/znc/.znc/config/znc.conf
echo " Nick = ${new_username}" >> /home/znc/.znc/config/znc.conf
echo " AltNick = ${new_username}_" >> /home/znc/.znc/config/znc.conf
echo " Ident = ${new_username}" >> /home/znc/.znc/config/znc.conf
echo " RealName = ${new_username}" >> /home/znc/.znc/config/znc.conf
echo ' Buffer = 100' >> /home/znc/.znc/config/znc.conf
echo ' AutoClearChanBuffer = true' >> /home/znc/.znc/config/znc.conf
echo ' ChanModes = +stn' >> /home/znc/.znc/config/znc.conf
echo '' >> /home/znc/.znc/config/znc.conf
echo ' LoadModule = chansaver' >> /home/znc/.znc/config/znc.conf
echo ' LoadModule = controlpanel' >> /home/znc/.znc/config/znc.conf
echo ' LoadModule = perform' >> /home/znc/.znc/config/znc.conf
echo '' >> /home/znc/.znc/config/znc.conf
echo " <Network ${PROJECT_NAME}>" >> /home/znc/.znc/config/znc.conf
echo ' LoadModule = chansaver' >> /home/znc/.znc/config/znc.conf
echo ' LoadModule = keepnick' >> /home/znc/.znc/config/znc.conf
echo ' LoadModule = perform' >> /home/znc/.znc/config/znc.conf
echo ' LoadModule = simple_away' >> /home/znc/.znc/config/znc.conf
echo '' >> /home/znc/.znc/config/znc.conf
echo " Server = ${DEFAULT_DOMAIN_NAME} +${IRC_PORT}" >> /home/znc/.znc/config/znc.conf
echo " Server = ${IRC_ONION_HOSTNAME} +${IRC_PORT}" >> /home/znc/.znc/config/znc.conf
echo '' >> /home/znc/.znc/config/znc.conf
echo " <Chan ${PROJECT_NAME}>" >> /home/znc/.znc/config/znc.conf
echo ' </Chan>' >> /home/znc/.znc/config/znc.conf
echo ' </Network>' >> /home/znc/.znc/config/znc.conf
echo '</User>' >> /home/znc/.znc/config/znc.conf
echo "<User ${new_username}>" >> /home/znc/.znc/configs/znc.conf
echo " Pass = ${new_user_pass}" >> /home/znc/.znc/configs/znc.conf
echo " Admin = ${is_admin}" >> /home/znc/.znc/configs/znc.conf
echo " Nick = ${new_username}" >> /home/znc/.znc/configs/znc.conf
echo " AltNick = ${new_username}_" >> /home/znc/.znc/configs/znc.conf
echo " Ident = ${new_username}" >> /home/znc/.znc/configs/znc.conf
echo " RealName = ${new_username}" >> /home/znc/.znc/configs/znc.conf
echo ' Buffer = 100' >> /home/znc/.znc/configs/znc.conf
echo ' AutoClearChanBuffer = true' >> /home/znc/.znc/configs/znc.conf
echo ' ChanModes = +stn' >> /home/znc/.znc/configs/znc.conf
echo '' >> /home/znc/.znc/configs/znc.conf
echo ' LoadModule = chansaver' >> /home/znc/.znc/configs/znc.conf
echo ' LoadModule = controlpanel' >> /home/znc/.znc/configs/znc.conf
echo ' LoadModule = perform' >> /home/znc/.znc/configs/znc.conf
echo '' >> /home/znc/.znc/configs/znc.conf
echo " <Network ${PROJECT_NAME}>" >> /home/znc/.znc/configs/znc.conf
echo ' LoadModule = chansaver' >> /home/znc/.znc/configs/znc.conf
echo ' LoadModule = keepnick' >> /home/znc/.znc/configs/znc.conf
echo ' LoadModule = perform' >> /home/znc/.znc/configs/znc.conf
echo ' LoadModule = simple_away' >> /home/znc/.znc/configs/znc.conf
echo '' >> /home/znc/.znc/configs/znc.conf
echo " Server = ${DEFAULT_DOMAIN_NAME} +${IRC_PORT}" >> /home/znc/.znc/configs/znc.conf
echo " Server = ${IRC_ONION_HOSTNAME} +${IRC_PORT}" >> /home/znc/.znc/configs/znc.conf
echo '' >> /home/znc/.znc/configs/znc.conf
echo " <Chan ${PROJECT_NAME}>" >> /home/znc/.znc/configs/znc.conf
echo ' </Chan>' >> /home/znc/.znc/configs/znc.conf
echo ' </Network>' >> /home/znc/.znc/configs/znc.conf
echo '</User>' >> /home/znc/.znc/configs/znc.conf
mkdir -p /home/znc/.znc/users/${new_username}/moddata
mkdir -p /home/znc/.znc/users/${new_username}/networks