Default irssi configuration for new users

This commit is contained in:
Bob Mottram 2016-02-27 16:14:44 +00:00
parent 6d2bca0c81
commit 625faf1eae
2 changed files with 71 additions and 3 deletions

View File

@ -7552,9 +7552,9 @@ function install_irc_client {
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 ' 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

View File

@ -34,6 +34,8 @@ PROJECT_NAME='freedombone'
export TEXTDOMAIN=${PROJECT_NAME}-adduser
export TEXTDOMAINDIR="/usr/share/locale"
CONFIGURATION_FILE=/root/${PROJECT_NAME}.cfg
MY_USERNAME=$1
SSH_PUBLIC_KEY="$2"
GPG_KEYSERVER='hkp://keys.gnupg.net'
@ -296,6 +298,72 @@ fi
# export OC_PASS=""
#fi
if grep -q "install_irc_client" $COMPLETION_FILE; then
IRC_PORT=6697
if grep -q "IRC_PORT" $CONFIGURATION_FILE; then
IRC_PORT=$(grep "IRC_PORT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if [ ! -d /home/$MY_USERNAME/.irssi ]; then
mkdir /home/$MY_USERNAME/.irssi
fi
echo 'servers = (' > /home/$MY_USERNAME/.irssi/config
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 = "yes";' >> /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 = "yes";' >> /home/$MY_USERNAME/.irssi/config
echo ' },' >> /home/$MY_USERNAME/.irssi/config
echo ' {' >> /home/$MY_USERNAME/.irssi/config
echo " address = \"${HOSTNAME}\";" >> /home/$MY_USERNAME/.irssi/config
echo ' chatnet = "Freedombone";' >> /home/$MY_USERNAME/.irssi/config
echo " port = \"${IRC_PORT}\";" >> /home/$MY_USERNAME/.irssi/config
echo ' use_ssl = "yes";' >> /home/$MY_USERNAME/.irssi/config
echo ' ssl_verify = "no";' >> /home/$MY_USERNAME/.irssi/config
echo ' autoconnect = "yes";' >> /home/$MY_USERNAME/.irssi/config
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
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.irssi
fi
# add user menu on ssh login
if ! grep -q 'control' /home/$MY_USERNAME/.bashrc; then
echo 'control' >> /home/$MY_USERNAME/.bashrc