Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
rc
rabbitmq_agents
Commits
397ca5d4
Commit
397ca5d4
authored
1 week ago
by
Dylan Wheeler
Browse files
Options
Downloads
Patches
Plain Diff
style: reformatting for more uniform style
parent
cb74b5b5
No related branches found
No related tags found
1 merge request
!158
FEAT: introduce shell script to allow user to disable another users crontab...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/crondisable.sh
+11
-12
11 additions, 12 deletions
scripts/crondisable.sh
with
11 additions
and
12 deletions
scripts/crondisable.sh
+
11
−
12
View file @
397ca5d4
#!/bin/bash
#!/bin/bash
usage
()
{
usage
()
{
echo
"Usage:
$0
-d USERNAME to disable a user"
echo
"Usage:
$0
-d USERNAME to disable a user"
echo
"Usage:
$0
-e USERNAME to re-enable a user"
echo
"Usage:
$0
-e USERNAME to re-enable a user"
}
}
if
[[
"
$EUID
"
-ne
0
]]
;
then
if
[[
"
$EUID
"
-ne
0
]]
;
then
echo
"This script must be run as root!"
echo
"This script must be run as root!"
exit
1
exit
1
fi
fi
if
[
"$#"
-eq
0
]
;
then
if
[
"$#"
-eq
0
]
;
then
usage
usage
exit
1
exit
1
fi
fi
while
getopts
':d:e:'
OPTION
;
do
while
getopts
':d:e:'
OPTION
;
do
case
$OPTION
in
case
$OPTION
in
d
)
d
)
mv
/var/spool/cron/
$OPTARG
/var/spool/cron/
$OPTARG
.disabled
mv
/var/spool/cron/
$OPTARG
/var/spool/cron/
$OPTARG
.disabled
echo
$OPTARG
>>
/etc/cron.deny
echo
$OPTARG
>>
/etc/cron.deny
;;
;;
e
)
e
)
mv
/var/spool/cron/
$OPTARG
.disabled /var/spool/cron/
$OPTARG
mv
/var/spool/cron/
$OPTARG
.disabled /var/spool/cron/
$OPTARG
sed
-i
-e
"/
$OPTARG
/d"
/etc/cron.deny
sed
-i
-e
"/
$OPTARG
/d"
/etc/cron.deny
;;
;;
esac
esac
done
done
\ No newline at end of file
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