cleaner implementation
authorChris Koeritz <fred@gruntose.com>
Fri, 3 Nov 2017 06:23:02 +0000 (02:23 -0400)
committerChris Koeritz <fred@gruntose.com>
Fri, 3 Nov 2017 06:23:02 +0000 (02:23 -0400)
adds a chmod of 600 to the swap file to keep the OS happy.  also checks result of each operation.

scripts/system/add_swap_mount.sh

index 64547bd5248db246b4d6d46b6627fae46c3edb01..200cb365095decb42ec8f4b4ed4ff1b4e3966954 100644 (file)
@@ -1,14 +1,22 @@
 #!/bin/bash
 
-#hmmm: should check at each step if it worked.
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
 #hmmm: should be able to add a new swap drive if desired.
 
+#hmmm: why all the hard-coded paths below?
 
 /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
+check_result "creating swap file"
+
+/bin/chmod 600 /var/swap.1
+check_result "setting swap file permissions"
 
 /sbin/mkswap /var/swap.1
+check_result "formatting swap file as swap partition"
 
 /sbin/swapon /var/swap.1
+check_result "enabling new swap partition"
 
 free