Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scripts
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
infra
scripts
Commits
195a29cc
Commit
195a29cc
authored
Feb 02, 2023
by
Joab Bremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
8fb18c10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
update_nxrelay.sh
update_nxrelay.sh
+29
-0
No files found.
update_nxrelay.sh
0 → 100644
View file @
195a29cc
#!/usr/bin/bash
echo
"Fazendo bkp do nxrelay"
cp
-r
/nxrelay /usr/local/nxrelay_bkp_
$(
date
+%d%m%Y
)
cd
/nxrelay
echo
"Baixando arquivo"
/usr/bin/wget
--quiet
--no-check-certificate
https://pub.nxfilter.org/imsi/nxrelay-2.7.8-adv.zip
/usr/bin/zip
-qq
-d
nxrelay-2.7.8-adv.zip
"conf/cfg.properties"
/usr/bin/zip
-qq
-d
nxrelay-2.7.8-adv.zip
"conf/log4j.properties"
echo
"Extraindo arquivos"
/usr/bin/systemctl stop nxrelay
/usr/bin/unzip
-qq
-o
nxrelay-2.7.8-adv.zip
/usr/bin/systemctl start nxrelay
echo
"Definindo variaveis"
PREFIX
=
$(
ip
-o
-4
addr list eth0 |
awk
'{print $4}'
|
cut
-d
/
-f2
)
sed
-i
'/local_dns/d'
/nxrelay/conf/cfg.properties
sed
-i
'/local_domain/d'
/nxrelay/conf/cfg.properties
sed
-i
'/token/a bypass_domain = adventistas.local'
/nxrelay/conf/cfg.properties
;
sed
-i
"/token/a bypass_dns =
$(
ip addr show eth0 |
grep
"inet
\b
"
|
awk
'{print $2}'
|
sed
-n
"s/1.
$PREFIX
/3/p"
)
,
$(
ip addr show eth0 |
grep
"inet
\b
"
|
awk
'{print $2}'
|
sed
-n
"s/1.
$PREFIX
/4/p"
)
"
/nxrelay/conf/cfg.properties
;
sed
-i
'/token/a local_domain = '
/nxrelay/conf/cfg.properties
;
sed
-i
'/token/a local_dns = 1.1.1.1,8.8.8.8'
/nxrelay/conf/cfg.properties
;
/usr/bin/systemctl restart nxrelay
sed
-i
'/distroverpkg/a exclude=nxrelay*'
/etc/yum.conf
;
echo
"Tudo OK!"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment