File: postinst

package info (click to toggle)
ircii 4.4-3
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 4,256 kB
  • ctags: 2,797
  • sloc: ansic: 36,743; sh: 907; makefile: 483; lex: 16
file content (56 lines) | stat: -rw-r--r-- 1,928 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh

set -e

update-alternatives --install /usr/bin/irc irc /usr/bin/ircII 20 \
                    --slave /usr/man/man1/irc.1.gz irc.1 /usr/man/man1/ircII.1.gz

if [ -f /etc/ircII.servers ]; then
	mv -f /etc/ircII.servers /etc/irc/servers
	rm -f /usr/lib/irc/ircII.servers
	echo "Moving /etc/ircII.servers to /etc/irc/servers"
else
  if [ -f /usr/lib/irc/ircII.servers -a ! -L /usr/lib/irc/ircII.servers ]; then
	mv /usr/lib/irc/ircII.servers /etc/irc/servers
	echo "Moving /usr/lib/irc/ircII.servers to /etc/irc/servers"
  else
	if [ ! -f /etc/irc/servers ]; then
		touch /etc/irc/servers
		echo -n "Please enter the address of your IRC server in the "
		echo "following format."
		echo
		echo -n "hostname:portnum:password (with the portnum and "
		echo "password being optional)."
		echo
		echo "Please be carefull to pick a server close to you."
		echo "The servers will be stored into /etc/irc/servers"
		echo
		echo "Default is __default_server__."
		echo -n "> "
		read TMP
		if [ ! -z $TMP ]; then
			cat >> /etc/irc/servers << END1
$TMP
END1
		fi
	fi
  fi
fi

echo "Debian provides a small default setup for ircII in /etc/irc/script/local"
if [ -f /usr/lib/irc/script/local ]; then
	echo "I found a local configuration script in /usr/lib/irc/script/."
	echo "If you skip this, you can add commands from /etc/irc/script/local.old"
	echo "to /etc/irc/script/local manually, later."
	echo -n "Replace Debians with your old configuration file? (Y/N) [N]"
	read input
        if [ "$input" = "y" -o "$input" = "Y" -o "$input" = "yes" -o "$input" = "Yes" ]
        then
	  echo "Moving your local script... (keeping Debian's in /etc/irc/script/local.debian)"
	  mv -f /etc/irc/script/local /etc/irc/script/local.debian
	  mv -f /usr/lib/irc/script/local /etc/irc/script/local
        else
          echo "Ok... using Debian's default setup."
	  mv -f /usr/lib/irc/script/local /etc/irc/script/local.old
        fi
fi