Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
e93d3bb4
Commit
e93d3bb4
authored
Aug 21, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
router: add skip egw
parent
90d69600
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
10 deletions
+53
-10
a_add_manual.sh
router/a_add_manual.sh
+18
-0
a_check_ip.sh
router/a_check_ip.sh
+13
-0
a_no_egw.sh
router/a_no_egw.sh
+17
-0
update_z-i.sh
router/update_z-i.sh
+5
-0
update_z-i_manual.sh
router/update_z-i_manual.sh
+0
-10
No files found.
router/a_add_manual.sh
0 → 100755
View file @
e93d3bb4
#!/bin/sh
SETNAME
=
rkz
arg
=
$1
get_ipv4_list
()
{
echo
"
$1
"
|
grep
-q
"[a-z]"
||
return
0
dig
"
$1
"
A |
grep
-v
"^;"
|
grep
"IN[[:space:]]*A[[:space:]]"
|
sed
-e
"s|.*[[:space:]]||"
}
for
ip
in
$(
get_ipv4_list
$arg
)
;
do
echo
"add
$ip
"
ipset add
$SETNAME
$ip
||
exit
echo
"
$ip
"
>>
a_manual.list
done
router/a_check_ip.sh
0 → 100755
View file @
e93d3bb4
#!/bin/sh
#exit
# Usage: --show|--force
cd
$(
dirname
"
$(
realpath
"
$0
"
)
"
)
||
exit
#"
SETNAME
=
rkz
TODEL
=
"
$1
"
ipset list
$SETNAME
|
grep
$TODEL
router/a_no_egw.sh
0 → 100755
View file @
e93d3bb4
#!/bin/sh
SETNAME
=
rkz
arg
=
$1
get_ipv4_list
()
{
echo
"
$1
"
|
grep
-q
"[a-z]"
||
return
0
dig
"
$1
"
A |
grep
-v
"^;"
|
grep
"IN[[:space:]]*A[[:space:]]"
|
sed
-e
"s|.*[[:space:]]||"
}
for
ip
in
$(
get_ipv4_list
$arg
)
;
do
echo
"add
$ip
"
ipset del
$SETNAME
$ip
echo
"
$ip
"
>>
a_no_egw.list
done
router/update_z-i.sh
View file @
e93d3bb4
...
...
@@ -88,6 +88,11 @@ ipset destroy $TMPNAME 2>/dev/null
(
echo
"create
$TMPNAME
$IPSTYPE
hashsize 65536 maxelem
$MAXELEM
"
;
\
cat
$0
.list |
grep
-v
"^$"
|
grep
-v
":"
|
sed
-e
"s|^|add
$TMPNAME
|"
)
| ipset
-exist
restore
# remove skipped ip
cat
a_no_egw.list |
grep
-v
"^ *#"
|
while
read
ip
;
do
ipset del
$TMPNAME
$ip
done
ipset list
$TMPNAME
>
$0
.ipv4
ipset list
$TMPNAME
|
wc
-l
>
$0
.count
ipset list
$TMPNAME
|
grep
"/"
>
$0
.subnet
...
...
router/update_z-i_manual.sh
deleted
100755 → 0
View file @
90d69600
#!/bin/sh
SETNAME
=
rkz
ip
=
$1
if
echo
"
$ip
"
|
grep
-q
"[a-z]"
;
then
ip
=
$(
resolve
-s
$ip
)
fi
ipset add
$SETNAME
$ip
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