Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lyz
backupninja
Commits
540f7e0f
Commit
540f7e0f
authored
19 years ago
by
intrigeri
Browse files
Options
Downloads
Patches
Plain Diff
ninjahelper: better check_perms(), improved xedit.
parent
49dfbcb8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog
+6
-0
6 additions, 0 deletions
changelog
ninjahelper
+25
-5
25 additions, 5 deletions
ninjahelper
with
31 additions
and
5 deletions
changelog
+
6
−
0
View file @
540f7e0f
...
...
@@ -20,6 +20,12 @@ version XX -- ...
now checks if the specified vserver is running.
now checks if $PGSQLDUMP/$PGSQLDUMPALL are available where needed.
now checks if "postgres" user exists on the host/vserver.
changes to ninjahelper
check_perms() does not die anymore on group/world readable
helper scripts (now consistent with the "helper scripts
must not be group or world writable!" error msg).
xedit action now tries $EDITOR, then /etc/alternatives/editor,
then nano, vim and vi, and aborts if none of these exists.
version 0.7 -- July 26 2005
added ninjahelper: a dialog based wizard for creating backupninja configs.
...
...
This diff is collapsed.
Click to expand it.
ninjahelper
+
25
−
5
View file @
540f7e0f
...
...
@@ -6,8 +6,9 @@
function
check_perms
()
{
local
file
=
$1
local
perms
=
`
ls
-ld
$file
`
perms
=
${
perms
:4:6
}
if
[[
"
$perms
"
!=
"------"
&&
"
$perms
"
!=
"r--r--"
]]
;
then
group_w_perm
=
${
perms
:5:1
}
world_w_perm
=
${
perms
:8:1
}
if
[
"
$group_w_perm
"
==
"w"
-o
"
$world_w_perm
"
==
"w"
]
;
then
echo
$perms
echo
"helper scripts must not be group or world writable! Dying on file
$file
"
exit
...
...
@@ -87,6 +88,25 @@ do_run() {
read
}
do_xedit
()
{
if
[
-z
"
$EDITOR
"
-o
!
-x
"
`
which
$EDITOR
`
"
]
;
then
if
[
-h
/etc/alternatives/editor
-a
-x
"
`
readlink
/etc/alternatives/editor
`
"
]
;
then
EDITOR
=
"
`
readlink
/etc/alternatives/editor
`
"
elif
[
-x
"
`
which nano
`
"
]
;
then
EDITOR
=
"
`
which nano
`
"
elif
[
-x
"
`
which vim
`
"
]
;
then
EDITOR
=
"
`
which vim
`
"
elif
[
-x
"
`
which vi
`
"
]
;
then
EDITOR
=
"
`
which vi
`
"
else
echo
"No suitable editor found."
echo
"Please define
$EDITOR
or configure /etc/alternatives/editor."
exit
fi
fi
$EDITOR
$1
}
do_run_test
()
{
backupninja
--test
--run
$1
echo
"Hit return to continue..."
...
...
@@ -130,7 +150,7 @@ doaction() {
result
=
"
$REPLY
"
case
"
$result
"
in
"view"
)
dialog
--textbox
$action
0 0
;;
"xedit"
)
$EDITOR
$action
;;
"xedit"
)
do_xedit
$action
;;
"disable"
)
do_disable
$action
;
return
;;
"enable"
)
do_enable
$action
;
return
;;
"name"
)
do_rename
$action
;
return
;;
...
...
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