Code Monkey home page Code Monkey logo

drive-mounting-script's Introduction

Simple script for mounting and un-mounting external drives

A script that mounts and unmounts usb drives.
Made for and tested with raspberry pi and ubuntu.

Better script comming soon!


Quick start:

First download if you havent already:
$ git clone https://github.com/WestleyK/drive-mounting-script.git

Then you can install the drive-mounter command:
$ ./auto-install.sh
Now you should be able to type drive-mounter insted of running the script.

For more info on installing or un-installing, click here.

User inerface:

After you run the command you can select a number that corresponds with the drive,
For example, you want to mount the first option, so type 1

$ drive-mounter
https://github.com/WestleyK/drive-mounting-script



1:/dev/sda1  *     8064 30277631 30269568 14.4G  c W95 FAT32 (LBA)
2:/dev/sdb1           2 126353407 126353406 60.3G  b W95 FAT32

what would you like to mount or un-mount? [1-8]

Then you can select to (m)mount, (u)un-mount or (r)remount? [m,u,r]
See, simple! :)

$ drive-mounter
https://github.com/WestleyK/drive-mounting-script



1:/dev/sda1  *     8064 30277631 30269568 14.4G  c W95 FAT32 (LBA)
2:/dev/sdb1           2 126353407 126353406 60.3G  b W95 FAT32

what would you like to mount or un-mount? [1-8]1

/dev/sda1

(m)mount, (u)un-mount or (r)remount?  [m,u,r]

Option menu:

Here is all the options avalable:

$ drive-mounter -help
	usage: driver-mounter [-option]
-h | -help | --help (display help menu)
-a | -all (unmount all drives)
-d (display all drives, mounted or not)
-m (mount drive only if there one)
-p (temporally change the mount point when mounting drive) (defalt:/media/pi)
-r (remount the drive, this only works if one drive is connected)


Install and uninstall:

For quick install, do:
$ ./auto-install.sh

For uninstall, do:
$ ./auto-install.sh -u

Manually install:

For manual install, do:
$ sudo chmod 777 raspberry-pi/drive-mounter && sudo cp -i raspberry-pi/drive-mounter /usr/bin/ for raspberry pi

Or for linux/ubuntu, do:
$ sudo chmod 777 linux-ubuntu/drive-mounter[-root] && sudo cp -i linux-ubuntu/drive-mounter[-root]

Manuall uninstall:

For manual uninstall, do:
$ sudo rm /usr/bin/drive-mounter


Changing the mount point:

If you just want to change the mount point temporally:
Then do $ drive-mounter -p. Otherwise, the instructions are below.

By defalt the sctipt will mount to /media/pi for raaspberry pi, and /media/usb-drives for linux/ubuntu.
You can easily change this by editing the driver-mounter.
For raspberry pi:$ vim raspberry-pi/drive-mounter, then uninstall and reinstall.
Or $ sudo vim /usr/bin/drive-mounter if you already installed it.

For linux/ubuntu:$ vim linux-ubuntu/drive-mounter, or edit the root script if thats what you will use.
Or $ sudo vim /usr/bin/drive-mounter if you already instelled it.


Known bugs:

  • cant uninstall linux-ubuntu/drive-mounter-root by script, have to uninstall manually.
  • need sudo to write to usb drive (linux/ubuntu only)
  • "-d" option does not work properly for linux/ubuntu.


More usage:

For more usage and abilities, type:
$ drive-mounter -help



End README


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.