Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4792461
autochmod-git.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
autochmod-git.sh
View Options
#!/bin/sh
# -------------------------------------------------------------
# Sets permissions for a group-shared Git repository
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
# If eligible, BSD-2-Clause
# Source file: roles/salt-primary/software/files/autochmod-git.sh
# -------------------------------------------------------------
#
# <auto-generated>
# This file is managed by our rOPS SaltStack repository.
#
# Changes to this file may cause incorrect behavior
# and will be lost if the state is redeployed.
# </auto-generated>
set
-e
# -------------------------------------------------------------
# Ensure user is root
#
# Note: POSIX shells don't always define $UID or $EUID.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if
[
"
$(
id -u
)
"
-ne
0
]
;
then
echo
"This command must be run as root."
>
&
2
exit
1
fi
# -------------------------------------------------------------
# Git information
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dir
=
$(
git rev-parse --show-toplevel
)
# -------------------------------------------------------------
# Let's chmod
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
set
-x
find
"
$dir
"
-print0 -type d
|
xargs -0 chmod g+xw
find
"
$dir
"
-print0 -type f
|
xargs -0 chmod g+w
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Fri, Feb 28, 20:13 (4 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2439199
Default Alt Text
autochmod-git.sh (1 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment