Tidying creation of irssi config
This commit is contained in:
parent
3b866cef44
commit
055af8d5c7
|
@ -64,6 +64,83 @@ function stop_irc_bouncer {
|
||||||
pkill znc
|
pkill znc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function create_irssi_config {
|
||||||
|
new_username="$1"
|
||||||
|
|
||||||
|
read_config_param IRC_BOUNCER_PORT
|
||||||
|
read_config_param IRC_ONION_PORT
|
||||||
|
read_config_param IRC_PASSWORD
|
||||||
|
|
||||||
|
new_name="$2"
|
||||||
|
if [ ${#new_name} -eq 0 ]; then
|
||||||
|
new_name="$new_username"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 'servers = (' > /home/${new_username}/.irssi/config
|
||||||
|
echo ' {' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' address = "chat.freenode.net";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' chatnet = "Freenode";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' port = "6667";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' autoconnect = "no";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' },' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' {' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' address = "irc.oftc.net";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' chatnet = "OFTC";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' port = "6667";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' autoconnect = "no";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' },' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' {' >> /home/${new_username}/.irssi/config
|
||||||
|
echo " address = \"127.0.0.1\";" >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' use_ssl = "yes";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' ssl_verify = "no";' >> /home/${new_username}/.irssi/config
|
||||||
|
if [[ ${ONION_ONLY} == 'no' ]]; then
|
||||||
|
echo " port = \"${IRC_BOUNCER_PORT}\";" >> /home/${new_username}/.irssi/config
|
||||||
|
else
|
||||||
|
IRC_ONION_HOSTNAME=$(cat ${COMPLETION_FILE} | grep "irc onion domain" | head -n 1 | awk -F ':' '{print $2}')
|
||||||
|
echo " port = \"${IRC_ONION_PORT}\";" >> /home/${new_username}/.irssi/config
|
||||||
|
fi
|
||||||
|
echo ' chatnet = "Freedombone";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' autoconnect = "yes";' >> /home/${new_username}/.irssi/config
|
||||||
|
if [ ${IRC_PASSWORD} ]; then
|
||||||
|
echo " password = \"${IRC_PASSWORD}\";" >> /home/${new_username}/.irssi/config
|
||||||
|
fi
|
||||||
|
echo ' }' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ');' >> /home/${new_username}/.irssi/config
|
||||||
|
echo '' >> /home/${new_username}/.irssi/config
|
||||||
|
echo 'chatnets = {' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' Freedombone = {' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' type = "IRC";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_kicks = "1";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_msgs = "4";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_whois = "1";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' };' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' Freenode = {' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' type = "IRC";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_kicks = "1";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_msgs = "4";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_whois = "1";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' };' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' OFTC = {' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' type = "IRC";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_kicks = "1";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_msgs = "1";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' max_whois = "1";' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' };' >> /home/${new_username}/.irssi/config
|
||||||
|
echo '};' >> /home/${new_username}/.irssi/config
|
||||||
|
echo '' >> /home/${new_username}/.irssi/config
|
||||||
|
echo 'channels = (' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' { name = "#freedombone"; chatnet = "Freedombone"; autojoin = "Yes"; },' >> /home/${new_username}/.irssi/config
|
||||||
|
echo ');' >> /home/${new_username}/.irssi/config
|
||||||
|
echo '' >> /home/${new_username}/.irssi/config
|
||||||
|
echo 'settings = {' >> /home/${new_username}/.irssi/config
|
||||||
|
echo " core = { real_name = \"$new_name\"; user_name = \"$new_username\"; nick = \"$new_username\"; };" >> /home/${new_username}/.irssi/config
|
||||||
|
echo ' "fe-text" = { actlist_sort = "refnum"; };' >> /home/${new_username}/.irssi/config
|
||||||
|
echo '};' >> /home/${new_username}/.irssi/config
|
||||||
|
echo 'ignores = ( { level = "CTCPS"; } );' >> /home/${new_username}/.irssi/config
|
||||||
|
|
||||||
|
chown -R ${new_username}:${new_username} /home/${new_username}/.irssi
|
||||||
|
}
|
||||||
|
|
||||||
function remove_user_irc_bouncer {
|
function remove_user_irc_bouncer {
|
||||||
remove_username="$1"
|
remove_username="$1"
|
||||||
|
|
||||||
|
@ -198,63 +275,7 @@ function add_user_irc {
|
||||||
mkdir /home/${new_username}/.irssi
|
mkdir /home/${new_username}/.irssi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'servers = (' > /home/${new_username}/.irssi/config
|
create_irssi_config "${new_username}"
|
||||||
echo ' {' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' address = "chat.freenode.net";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' chatnet = "Freenode";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' port = "6667";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' autoconnect = "no";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' },' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' {' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' address = "irc.oftc.net";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' chatnet = "OFTC";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' port = "6667";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' autoconnect = "yes";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' },' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' {' >> /home/${new_username}/.irssi/config
|
|
||||||
echo " address = \"${HOSTNAME}\";" >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' chatnet = "Freedombone";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo " port = \"${IRC_PORT}\";" >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' use_ssl = "yes";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' ssl_verify = "no";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' autoconnect = "yes";' >> /home/${new_username}/.irssi/config
|
|
||||||
|
|
||||||
echo ' }' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ');' >> /home/${new_username}/.irssi/config
|
|
||||||
echo '' >> /home/${new_username}/.irssi/config
|
|
||||||
echo 'chatnets = {' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' Freedombone = {' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' type = "IRC";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_kicks = "1";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_msgs = "4";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_whois = "1";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' };' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' Freenode = {' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' type = "IRC";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_kicks = "1";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_msgs = "4";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_whois = "1";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' };' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' OFTC = {' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' type = "IRC";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_kicks = "1";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_msgs = "1";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' max_whois = "1";' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' };' >> /home/${new_username}/.irssi/config
|
|
||||||
echo '};' >> /home/${new_username}/.irssi/config
|
|
||||||
echo '' >> /home/${new_username}/.irssi/config
|
|
||||||
echo 'channels = (' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' { name = "#freedombone"; chatnet = "Freedombone"; autojoin = "Yes"; },' >> /home/${new_username}/.irssi/config
|
|
||||||
echo ');' >> /home/${new_username}/.irssi/config
|
|
||||||
echo '' >> /home/${new_username}/.irssi/config
|
|
||||||
echo 'settings = {' >> /home/${new_username}/.irssi/config
|
|
||||||
echo " core = { real_name = \"$MY_NAME\"; user_name = \"$new_username\"; nick = \"$new_username\"; };" >> /home/${new_username}/.irssi/config
|
|
||||||
echo ' "fe-text" = { actlist_sort = "refnum"; };' >> /home/${new_username}/.irssi/config
|
|
||||||
echo '};' >> /home/$new_username/.irssi/config
|
|
||||||
echo 'ignores = ( { level = "CTCPS"; } );' >> /home/${new_username}/.irssi/config
|
|
||||||
|
|
||||||
chown -R ${new_username}:${new_username} /home/${new_username}/.irssi
|
|
||||||
|
|
||||||
add_user_irc_bouncer "${new_username}" "${IRC_PASSWORD}"
|
add_user_irc_bouncer "${new_username}" "${IRC_PASSWORD}"
|
||||||
echo '0'
|
echo '0'
|
||||||
}
|
}
|
||||||
|
@ -542,70 +563,7 @@ function install_irc_client {
|
||||||
mkdir /home/${MY_USERNAME}/.irssi
|
mkdir /home/${MY_USERNAME}/.irssi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'servers = (' > /home/${MY_USERNAME}/.irssi/config
|
create_irssi_config "${MY_USERNAME}" "$MY_NAME"
|
||||||
echo ' {' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' address = "chat.freenode.net";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' chatnet = "Freenode";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' port = "6667";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' autoconnect = "no";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' },' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' {' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' address = "irc.oftc.net";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' chatnet = "OFTC";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' port = "6667";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' autoconnect = "no";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' },' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' {' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo " address = \"127.0.0.1\";" >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' use_ssl = "yes";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' ssl_verify = "no";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
if [[ ${ONION_ONLY} == 'no' ]]; then
|
|
||||||
echo " port = \"${IRC_BOUNCER_PORT}\";" >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
else
|
|
||||||
IRC_ONION_HOSTNAME=$(cat ${COMPLETION_FILE} | grep "irc onion domain" | head -n 1 | awk -F ':' '{print $2}')
|
|
||||||
echo " port = \"${IRC_ONION_PORT}\";" >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
fi
|
|
||||||
echo ' chatnet = "Freedombone";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' autoconnect = "yes";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
if [ ${IRC_PASSWORD} ]; then
|
|
||||||
echo " password = \"${IRC_PASSWORD}\";" >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
fi
|
|
||||||
echo ' }' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ');' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo '' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo 'chatnets = {' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' Freedombone = {' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' type = "IRC";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_kicks = "1";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_msgs = "4";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_whois = "1";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' };' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' Freenode = {' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' type = "IRC";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_kicks = "1";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_msgs = "4";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_whois = "1";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' };' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' OFTC = {' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' type = "IRC";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_kicks = "1";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_msgs = "1";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' max_whois = "1";' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' };' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo '};' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo '' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo 'channels = (' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' { name = "#freedombone"; chatnet = "Freedombone"; autojoin = "Yes"; },' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ');' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo '' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo 'settings = {' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo " core = { real_name = \"$MY_NAME\"; user_name = \"$MY_USERNAME\"; nick = \"$MY_USERNAME\"; };" >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo ' "fe-text" = { actlist_sort = "refnum"; };' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo '};' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
echo 'ignores = ( { level = "CTCPS"; } );' >> /home/${MY_USERNAME}/.irssi/config
|
|
||||||
|
|
||||||
chown -R ${MY_USERNAME}:${MY_USERNAME} /home/${MY_USERNAME}/.irssi
|
|
||||||
|
|
||||||
install_completed irc_client
|
install_completed irc_client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue