Skip to content

Commit da04910

Browse files
committed
Update chsh hook and add more hook commands
1 parent 7f96af6 commit da04910

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

distrod_packer/resources/bin/adduser

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
ORIG="$(PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin command -v adduser)"
4+
if [ -t 0 ]; then
5+
echo "[Distrod] Run 'sudo /opt/distrod/bin/distrod enable' after this command succeeds." >&2
6+
echo "[Distrod] It's necessary for Systemd to work as the pseudo init process." >&2
7+
fi
8+
"$ORIG" "$@"

distrod_packer/resources/bin/chsh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22

3-
ORIG_CHSH=""$(which -a chsh | tail -n 1)""
3+
ORIG="$(PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin command -v chsh)"
44
if [ -t 0 ]; then
5-
echo "[Distrod] Run 'sudo /opt/distrod/distrod enable' after chsh succeeds." >&2
6-
echo "[Distrod] It's necessary for Systemd to work as the init process." >&2
5+
echo "[Distrod] Run 'sudo /opt/distrod/bin/distrod enable' after this command succeeds." >&2
6+
echo "[Distrod] It's necessary for Systemd to work as the pseudo init process." >&2
77
fi
8-
"$ORIG_CHSH" "$@"
8+
"$ORIG" "$@"

distrod_packer/resources/bin/useradd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
ORIG="$(PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin command -v useradd)"
4+
if [ -t 0 ]; then
5+
echo "[Distrod] Run 'sudo /opt/distrod/bin/distrod enable' after this command succeeds." >&2
6+
echo "[Distrod] It's necessary for Systemd to work as the pseudo init process." >&2
7+
fi
8+
"$ORIG" "$@"

0 commit comments

Comments
 (0)