-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a hooks that stores/preserves the machine-id for your system.
- Loading branch information
1 parent
342acad
commit 3d362b4
Showing
2 changed files
with
28 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env sh | ||
set -e | ||
|
||
help() { | ||
echo "Help..." | ||
} | ||
|
||
install() { | ||
# Let's copy our a machine-id if we | ||
# haven't currently stored it. | ||
if [ ! -e /etc/darch/hooks/current-machine-id ]; then | ||
if [ -e /etc/machine-id ]; then | ||
cp /etc/machine-id /etc/darch/hooks/current-machine-id | ||
fi | ||
fi | ||
|
||
cp /etc/darch/hooks/current-machine-id . || true | ||
} | ||
|
||
run() { | ||
if [ -e "$DARCH_HOOK_DIR/current-machine-id" ]; then | ||
rm -f "$DARCH_ROOT_FS/etc/machine-id" | ||
mkdir -p "$DARCH_ROOT_FS/etc" || true | ||
cp "$DARCH_HOOK_DIR/current-machine-id" "$DARCH_ROOT_FS/etc/machine-id" | ||
fi | ||
} |