From 4c2c225324e9ed44af23185c573af94397a06343 Mon Sep 17 00:00:00 2001 From: Aditya Date: Sat, 14 Jan 2023 22:00:50 +0530 Subject: [PATCH] Add 10.2 - Add /etc/fstab --- scripts/chapter10/10.2-fstab.sh | 19 +++++++++++++++++++ scripts/main.sh | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 scripts/chapter10/10.2-fstab.sh diff --git a/scripts/chapter10/10.2-fstab.sh b/scripts/chapter10/10.2-fstab.sh new file mode 100644 index 0000000..7840dbd --- /dev/null +++ b/scripts/chapter10/10.2-fstab.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +cat > /etc/fstab << "EOF" +# Begin /etc/fstab + +# file system mount-point type options dump fsck +# order + +/dev/ / defaults 1 1 +/dev/ swap swap pri=1 0 0 +proc /proc proc nosuid,noexec,nodev 0 0 +sysfs /sys sysfs nosuid,noexec,nodev 0 0 +devpts /dev/pts devpts gid=5,mode=620 0 0 +tmpfs /run tmpfs defaults 0 0 +devtmpfs /dev devtmpfs mode=0755,nosuid 0 0 + +# End /etc/fstab +EOF + diff --git a/scripts/main.sh b/scripts/main.sh index e579c59..4f63299 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -1547,3 +1547,16 @@ then stop_script "chapter9/9.9-shells.sh" fi +# Chapter 10.2 +# ============ +echo "Chapter 10" +echo "Creating /etc/fstab" +su -c "bash $SCRIPT/chapter10/10.2-fstab.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter10/10.2-fstab.sh" +fi +