mirror of
https://github.com/RasppleII/a2cloud.git
synced 2024-12-23 19:29:33 +00:00
Add a2chat to source tree
This commit is contained in:
parent
82eb52db9f
commit
99e870238d
48
setup/a2chat.txt
Normal file
48
setup/a2chat.txt
Normal file
@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ ! $(dpkg -l irssi 2> /dev/null | grep '^ii') ]]; then
|
||||
echo "Installing irssi..."
|
||||
supo apt-get -y update
|
||||
sudo apt-get -y install irssi &> /dev/null
|
||||
sudo apt-get -y clean
|
||||
fi
|
||||
|
||||
if [[ $1 == "-n" && $2 ]]; then
|
||||
nickname=$2
|
||||
elif [[ $1 == "-n" ]]; then
|
||||
nickname="0"
|
||||
elif [[ -f ~/.irssi/a2c.nickname ]]; then
|
||||
nickname=$(cat ~/.irssi/a2c.nickname)
|
||||
else
|
||||
nickname=
|
||||
fi
|
||||
|
||||
while [[ ! $nickname || ! $(grep -i '^[a-z_\-\\^{}|`][a-z0-9_\-\\^{}|`]*$' <<< $nickname) ]]; do
|
||||
echo -n "Enter a nickname for chat (to change later, use 'a2chat -n'): "
|
||||
read
|
||||
nickname=$REPLY
|
||||
done
|
||||
|
||||
mkdir -p ~/.irssi
|
||||
echo $nickname > ~/.irssi/a2c.nickname
|
||||
|
||||
if [[ -f ~/.irssi/startup ]]; then
|
||||
mv ~/.irssi/startup ~/.irssi/startup.orig
|
||||
fi
|
||||
echo -e "/network add -autosendcmd '/join #a2c.chat' Palomino.A2\n/server add -auto -network Palomino.A2 irc.a2central.com\n" > ~/.irssi/startup
|
||||
|
||||
if [[ -f ~/.irssi/config ]]; then
|
||||
cp ~/.irssi/config ~/.irssi/config.orig
|
||||
fi
|
||||
|
||||
irssi -n $nickname
|
||||
|
||||
rm ~/.irssi/startup &> /dev/null
|
||||
if [[ -f ~/.irssi/startup.orig ]]; then
|
||||
mv ~/.irssi/startup.orig ~/.irssi/startup
|
||||
fi
|
||||
|
||||
rm ~/.irssi/config &> /dev/null
|
||||
if [[ -f ~/.irssi/config.orig ]]; then
|
||||
mv ~/.irssi/config.orig ~/.irssi/config
|
||||
fi
|
Loading…
Reference in New Issue
Block a user