From 48f7e4f75d42cb0c5e16d8078db86708e0c9efde Mon Sep 17 00:00:00 2001 From: BakedSnake Date: Wed, 3 Feb 2021 03:08:39 +0100 Subject: initial commit --- sdrive | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 sdrive (limited to 'sdrive') diff --git a/sdrive b/sdrive new file mode 100755 index 0000000..3452a1a --- /dev/null +++ b/sdrive @@ -0,0 +1,52 @@ +#!/bin/sh + +# Paths +drive= /dev/fd0 + +# Functions +prepDrive() { + echo 'preparing drive...' + setfdprm $drive sect=10 hd ssize=1024 cyl=80 +} + +formatDisk() { + echo 'formatting disk...' + superformat $drive sect=10 hd ssize=1024 cyl=80 +} + +iptImg() { + echo 'Enter the destination file path' + read iptloc + echo 'importing...' + cat $drive > $iptloc +} + +writeDisk() { + echo 'Enter img path' + read iptimg + echo 'writting' + cat $iptimg > $drive +} + +echo " + ###################################### + # S-Series Drive :: Shell Script # + ###################################### + + What would you like to do? + + 1. Prepare drive + 2. Format disk + 3. Import img from disk + 4. Write img to disk +" + +read choice + +case "$choice" in + 1) prepDrive ;; + 2) formatDisk ;; + 3) iptImg ;; + 4) writeDisk ;; +esac + -- cgit v1.2.3