←︎ tools :: f7dbb56


1
commit f7dbb564dd7542a42cbdce422393c251caf63c58
2
Author: acidvegas <acid.vegas@acid.vegas>
3
Date:   Sat Feb 15 15:11:36 2020 -0500
4
5
    updated
6
---
7
 deploy-unrealircd | 48 ++++++++++++++++++++++++++----------------------
8
 1 file changed, 26 insertions(+), 22 deletions(-)
9
10
diff --git a/deploy-unrealircd b/deploy-unrealircd
11
index 49831d4..b787771 100755
12
--- a/deploy-unrealircd
13
+++ b/deploy-unrealircd
14
@@ -1,7 +1,13 @@
15
 #!/bin/sh
16
-set -xev
17
 
18
-CURRENT='4.2.4.1'
19
+# ./unreal gencloak
20
+# gpg --keyserver keys.gnupg.net --recv-keys 0xA7A21B0A108FF4A9
21
+# wget https://www.unrealircd.org/downloads/unrealircd-5.0.0-alpha3.tar.gz.asc
22
+# gpg --verify unrealircd-5.0.0-alpha3.tar.gz.asc unrealircd-5.0.0-alpha3.tar.gz
23
+
24
+#set -xev
25
+
26
+CURRENT='5.0.3.1'
27
 BACKUP=$HOME/unrealircd.backup
28
 SOURCE=$HOME/unrealircd.source
29
 UNREAL=$HOME/unrealircd
30
@@ -12,7 +18,6 @@ deploy() {
31
 	rm $UNREAL/conf/*.conf
32
 	read -p "Link Name: " NAME
33
 	SID=$(cat /dev/urandom | tr -dc '0-9' | fold -w 256 | head -n 1 | head --bytes 1)$(cat /dev/urandom | tr -dc 'A-Z0-9' | fold -w 2 | head -n 1)
34
-	echo "[NOTE] - Your remote include should be in http(s)://USERNAME:PASSWORD@HOSTNAME:PORT format"
35
 	read -p "Remote Include: " REMOTE
36
 	for item in aliases badwords except help ircd modules opers spamfilter; do echo $REMOTE/$item.conf >> $UNREAL/conf/unrealircd.conf; done
37
 	echo "me { name \"$NAME.supernets.org\"; info \"SuperNETs IRC Network\"; sid $SID; }" >> $UNREAL/conf/unrealircd.conf
38
@@ -21,42 +26,41 @@ deploy() {
39
 	$UNREAL/unrealircd start &
40
 }
41
 
42
+#todo: fix this mess
43
 latest() {
44
 	local LATEST=$(curl -s https://www.unrealircd.org/downloads/list.json | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^version/ {print $2}' | sed 's/\(^"\|"$\)//g')
45
-	[ $LATEST != $CURRENT ] && echo "new version available: $LATEST"
46
+	[ "$LATEST" != "$CURRENT" ] && echo "new version available: $LATEST"
47
 }
48
 
49
 update() {
50
-	[ ! -z $(screen -ls | grep ircdwatchdog) ] && screen -S ircdwatchdog -X quit
51
-	[ ! -z $(abduco     | grep ircdwatchdog) ] && pkill -9 $(abduco | grep ircdwatchdog | awk '{print $4}')
52
-	mkdir $BACKUP
53
-	cp $UNREAL/conf/unrealircd.conf $BACKUP && cp $UNREAL/conf/ssl/server.*.pem $BACKUP
54
-	#cp $UNREAL/conf/links.conf $BACKUP && cp $UNREAL/conf/modules.conf $BACKUP && cp $UNREAL/conf/opers.conf $BACKUP
55
-	$UNREAL/unrealircd stop
56
-	rm -rf $UNREAL
57
+	#[ ! -z $(screen -ls | grep ircdwatchdog) ] && screen -S ircdwatchdog -X quit
58
+	#[ ! -z $(abduco     | grep ircdwatchdog) ] && pkill -9 $(abduco | grep ircdwatchdog | awk '{print $4}')
59
+	mkdir $BACKUP && cp $UNREAL/conf/unrealircd.conf $BACKUP && cp $UNREAL/conf/tls/server.*.pem $BACKUP
60
+	$UNREAL/unrealircd stop && rm -rf $UNREAL
61
 	git clone --depth 1 https://github.com/supernets/unrealircd.git $SOURCE
62
 	cd $SOURCE && echo -e "\n" | ./Config -nointro && make && make install && cd $HOME && rm -rf $SOURCE
63
-	mv $BACKUP/*.conf $UNREAL/conf/ && mv $BACKUP/server.*.pem $UNREAL/conf/ssl
64
-	rm -r $BACKUP
65
+	rm $UNREAL/conf/*.conf && mv $BACKUP/*.conf $UNREAL/conf/ && mv $BACKUP/server.*.pem $UNREAL/conf/tls && rm -r $BACKUP
66
 	$UNREAL/unrealircd start
67
-	watchdog
68
+	#watchdog
69
 }
70
 
71
 update_source() {
72
 	wget -O $SOURCE.tar.gz https://www.unrealircd.org/downloads/unrealircd-latest.tar.gz
73
-	tar -xvf $SOURCE.tar.gz --one-top-level --strip-components=1
74
-	rm $SOURCE.tar.gz
75
+	tar -xvf $SOURCE.tar.gz --one-top-level --strip-components=1 && rm $SOURCE.tar.gz
76
 	sed -i 's/NICKNAMEHISTORYLENGTH="2000"/NICKNAMEHISTORYLENGTH="100"/g' $SOURCE/Config
77
 	sed -i 's/REMOTEINC=""/REMOTEINC="1"/g' $SOURCE/Config
78
 	sed -i 's/PREFIXAQ="1"/PREFIXAQ="0"/g' $SOURCE/Config
79
 	sed -i 's/SHOWLISTMODES="1"/SHOWLISTMODES="0"/g' $SOURCE/Config
80
+	sed -i 's_\t$(INSTALL) -m 0600 doc/conf/*.default.conf @CONFDIR@_$(INSTALL) -m 0600 doc/conf/*.conf @CONFDIR@_g' $SOURCE/Makefile.in
81
+	sed -i 's_\t$(INSTALL) -m 0600 doc/conf/*.optional.conf @CONFDIR@_$(INSTALL) -m 0600 doc/conf/*.motd @CONFDIR@_g' $SOURCE/Makefile.in
82
+	sed -i '177,192d' $SOURCE/Makefile.in          # https://github.com/unrealircd/unrealircd/blob/unreal50/Makefile.in          |
83
+	sed -i '279,296d' $SOURCE/src/modules/sajoin.c # https://github.com/unrealircd/unrealircd/blob/unreal50/src/modules/sajoin.c | Note: These line numbers may change with updates!
84
+	sed -i '162,177d' $SOURCE/src/modules/sapart.c # https://github.com/unrealircd/unrealircd/blob/unreal50/src/modules/sapart.c |
85
+	sed -i 's/0.organizationName_default      = IRC geeks/0.organizationName_default      = SuperNETs/g' $SOURCE/extras/tls.cnf
86
 	sed -i 's;//#undef FAKELAG_CONFIGURABLE;#define FAKELAG_CONFIGURABLE;g' $SOURCE/include/config.h
87
-	sed -i 's_\t\t\tsendnotice(acptr, "*** You were forced to join %s", jbuf);_\t\t\t//sendnotice(acptr, "*** You were forced to join %s", jbuf);_g' $SOURCE/src/modules/m_sapart.c
88
-	rm -r $SOURCE/doc/conf/aliases $SOURCE/doc/conf/examples $SOURCE/doc/conf/help
89
-	rm -r $SOURCE/doc/conf/*.conf
90
-	cp $HOME/dev/git/supernets/unrealircd/doc/conf/*.conf $SOURCE/doc/conf/
91
-	cp $HOME/dev/git/supernets/unrealircd/src/ssl.cnf $SOURCE/src/ssl.cnf
92
-	echo "edit your Makefile.in"
93
+	rm -r $SOURCE/doc/conf/aliases $SOURCE/doc/conf/examples *.conf
94
+	cp $HOME/dev/git/supernets/unrealircd/doc/conf/* $SOURCE/doc/conf/
95
+	cp $SOURCE/doc/conf/help/help.conf $SOURCE/doc/conf/help.conf && rm -r $SOURCE/doc/conf/help/
96
 }
97
 
98
 watchdog() {