Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Git Rsync To OpenWRT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tools
Docker
Git Rsync To OpenWRT
Commits
08af3f79
Commit
08af3f79
authored
6 months ago
by
Dmitriy Safronov
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
3ab203ca
No related branches found
No related tags found
1 merge request
!9
update
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
entrypoint.sh
+7
-9
7 additions, 9 deletions
entrypoint.sh
sync.sh
+2
-24
2 additions, 24 deletions
sync.sh
with
9 additions
and
33 deletions
entrypoint.sh
+
7
−
9
View file @
08af3f79
#!/usr/bin/env sh
die
()
{
RED
=
'\033[0;31m'
NC
=
'\033[0m'
# No Color
echo
-e
'\[ '
"
${
RED
}
$1
${
NC
}
"
' ]/'
echo
-e
"*
$1
"
exit
1
}
...
...
@@ -15,4 +13,4 @@ rsync -a /opt/ /home/openwrt/.ssh/ || die "Couldn't rsync user ssh settings"
chown
-R
openwrt:openwrt /home/openwrt/.ssh
||
die
"Couldn't change ownership for user ssh settings"
chmod
-R
a-rwx,u+rwX /home/openwrt/.ssh
||
die
"Couldn't change access rights for user ssh settings"
exec sudo
-u
openwrt
-g
openwrt
-E
-H
sh
-c
'exec sh /sync.sh'
||
die
"Couldn't run sync sript as user"
exec sudo
-u
openwrt
-g
openwrt
-E
-H
sh
-c
'exec sh /sync.sh'
||
die
"Couldn't run sync s
c
ript as user"
This diff is collapsed.
Click to expand it.
sync.sh
+
2
−
24
View file @
08af3f79
#!/usr/bin/env sh
RED
=
'\033[0;31m'
GREEN
=
'\033[0;32m'
YELLOW
=
'\033[0;33m'
BLUE
=
'\033[0;34m'
NC
=
'\033[39m'
# No Color
die
()
{
echo
-e
'[ '
"
${
RED
}
$1
${
NC
}
"
' ]'
echo
-e
"*
$1
"
exit
1
}
warning
()
{
echo
-e
'[ '
"
${
YELLOW
}
$1
${
NC
}
"
' ]'
}
notify
()
{
echo
-e
'[ '
"
${
BLUE
}
$1
${
NC
}
"
' ]'
}
success
()
{
echo
-e
'[ '
"
${
GREEN
}
$1
${
NC
}
"
' ]'
}
warning
"Starting at
$(
date
-u
)
"
find overlay/
-type
f
-name
.gitkeep
-delete
LC_ALL
=
C.UTF-8 rsync
-acxv
--no-times
--delete-after
--exclude
'*-opkg'
-e
"ssh -p
${
OPENWRT_SSH_PORT
:-
22
}
"
overlay/
"
${
OPENWRT_SSH_HOST
:-
root
@192.168.0.1
}
:/overlay/upper/"
||
die
"Couldn't rsync config"
success
"Done at
$(
date
-u
)
"
LC_ALL
=
C.UTF-8 rsync
-acxv
--no-times
--delete-after
--exclude
'*-opkg'
-e
"ssh -p
${
OPENWRT_SSH_PORT
:-
22
}
"
overlay/
"
${
OPENWRT_SSH_HOST
:-
root
@192.168.1.1
}
:/overlay/upper/"
||
die
"Couldn't rsync config"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment