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
5b5b6063
Commit
5b5b6063
authored
Jun 27, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve rooter scripts
parent
d9fbb338
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
add_eterkey.sh
rooter/add_eterkey.sh
+1
-1
get_iptables.sh
rooter/get_iptables.sh
+2
-2
get_ssh_pubkey.sh
rooter/get_ssh_pubkey.sh
+2
-1
get_vzlist.sh
rooter/get_vzlist.sh
+2
-2
No files found.
rooter/add_eterkey.sh
View file @
5b5b6063
...
...
@@ -49,7 +49,7 @@ HSSH=/home/$USERNAME/.ssh
# TODO: исправить повторное добавление ключей
add_key_cmd
()
{
echo
"
$SUDO
useradd
$USERNAME
;
$SUDO
su -
$USERNAME
-c 'mkdir -p
$HSSH
; chmod 700
$HSSH
; touch
$HSSH
/authorized_keys ; chmod 600
$HSSH
/authorized_keys
' ; cat >>
$HSSH
/authorized_keys
"
echo
"
$SUDO
useradd
$USERNAME
;
$SUDO
su -
$USERNAME
-c 'mkdir -p
$HSSH
; chmod 700
$HSSH
; touch
$HSSH
/authorized_keys ; chmod 600
$HSSH
/authorized_keys
; cat >>
$HSSH
/authorized_keys'
"
}
# copy key in host system
...
...
rooter/get_iptables.sh
View file @
5b5b6063
...
...
@@ -6,7 +6,7 @@
fatal
()
{
echo
"Error:
$@
"
echo
"Error:
$@
"
>
&2
exit
1
}
...
...
@@ -23,4 +23,4 @@ shift
echo
"
$HOSTLIST
"
|
grep
-q
--
"
$HOST
"
||
fatal
"Unknown host
$HOST
. Call to the administrator."
fastssh
"root@
$HOST
"
$SUDO
iptables
-L
-n
-t
nat |
grep
"^DNAT"
fastssh
"root@
$HOST
"
$SUDO
iptables
-L
-n
-t
nat |
grep
"^DNAT"
|
sed
-e
"s/
\+
$/
/g"
rooter/get_ssh_pubkey.sh
View file @
5b5b6063
...
...
@@ -22,7 +22,8 @@ else
HOMEDIR
=
/home/
$USERNAME
fi
USERKEY
=
$HOMEDIR
/.ssh/id_dsa.pub
USERKEY
=
$HOMEDIR
/.ssh/id_ed25519.pub
[
-r
"
$USERKEY
"
]
||
USERKEY
=
$HOMEDIR
/.ssh/id_dsa.pub
[
-r
"
$USERKEY
"
]
||
USERKEY
=
$HOMEDIR
/.ssh/id_rsa.pub
#[ -r "$USERKEY" ] || fatal "Can't read ssh key $USERKEY"
...
...
rooter/get_vzlist.sh
View file @
5b5b6063
...
...
@@ -6,14 +6,14 @@
fatal
()
{
echo
"Error:
$@
"
echo
"Error:
$@
"
>
&2
exit
1
}
# 5 minutes cache
is_obsoleted
()
{
test
-z
"
$(
find
"
$1
"
-cmin
-
5
2>/dev/null
)
"
test
-z
"
$(
find
"
$1
"
-cmin
-
1200
2>/dev/null
)
"
}
get_log
()
...
...
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