forked from EESSI/filesystem-layer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:eessi/compatibility-layer into ex…
…plain_hosts_file
- Loading branch information
Showing
15 changed files
with
75 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
function echo_green() { | ||
echo -e "\e[32m$1\e[0m" | ||
} | ||
|
||
function echo_red() { | ||
echo -e "\e[31m$1\e[0m" | ||
} | ||
|
||
function echo_yellow() { | ||
echo -e "\e[33m$1\e[0m" | ||
} | ||
|
||
if [ -z $EPREFIX ]; then | ||
echo_red "ERROR: \$EPREFIX not defined" >&2 | ||
exit 1 | ||
fi | ||
|
||
EXPECTED_START='/cvmfs/pilot.eessi-hpc.org' | ||
if [[ $EPREFIX != $EXPECTED_START/* ]]; then | ||
echo_red "ERROR: \$EPREFIX does not start with '$EXPECTED_START': EPREFIX=$EPREFIX" >&2 | ||
exit 1 | ||
fi | ||
|
||
# /etc/passwd: required to ensure local users are known (see https://github.com/EESSI/compatibility-layer/issues/15) | ||
# /etc/group: required to ensure local user groups are known | ||
for path in /etc/passwd /etc/group; do | ||
echo ">> checking $path ..." | ||
ls -ld ${EPREFIX}$path | grep " -> $path" > /dev/null | ||
ec=$? | ||
if [ $ec -ne 0 ]; then | ||
echo_yellow ">> [CHANGE] ${EPREFIX}$path is *not* a symlink to $path, fixing that..." | ||
rm ${EPREFIX}$path | ||
ln -s $path ${EPREFIX}$path | ||
else | ||
echo_green ">> [OK] ${EPREFIX}$path is already a symlink to $path" | ||
fi | ||
done |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.