aboutsummaryrefslogtreecommitdiffstats
path: root/chroot
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-02-15 07:43:31 +0000
committerterminaldweller <thabogre@gmail.com>2022-02-15 07:43:31 +0000
commitb464c7424b20e9e03ac5046d235acb5970196382 (patch)
tree75c6f65385ba53851e1401f83e50781ba9cbb9d7 /chroot
parentadding device files manually now and working for void chroots (diff)
downloadscripts-b464c7424b20e9e03ac5046d235acb5970196382.tar.gz
scripts-b464c7424b20e9e03ac5046d235acb5970196382.zip
now make_devices complains if not run with root
Diffstat (limited to 'chroot')
-rwxr-xr-xchroot/make_devices.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/chroot/make_devices.sh b/chroot/make_devices.sh
index d333615..f4191bd 100755
--- a/chroot/make_devices.sh
+++ b/chroot/make_devices.sh
@@ -1,5 +1,10 @@
#!/bin/sh
+if [ ! "$EUID" = 0 ];then
+ echo "this scripts must be run as root"
+ exit 1;
+fi
+
make_devices() {
env mknod -m 0666 $1/dev/tty c 5 0
chown root:tty $1/dev/tty