Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#!/bin/bash #created by Kris Occhipinti #http://filmsbykris.com #Thu Apr 7 12:44:27 EDT 2016 #GPLv3 http://www.gnu.org/licenses/gpl-3.0.html #source code http://pastebin.com/CGaDFjcc #colors blink=`echo -en "\e[5m"` RED=`echo -en "\e[41m"` bold=`echo -en "\e[1m"` DEFAULT=`echo -en "\e[49m"` cat << EOF This script will detect a new USB drive. Please make sure that the drive is not plugged in and press
when ready. EOF read echo "Please plug the drive in and press
when ready" read echo "Checking for a new USB Drive" sleep 1 #Check for new USB drives added in the last minute id="$(find /dev/disk/by-id/usb* -mmin -1 -print|grep -v 'part')" let count=$(find /dev/disk/by-id/usb* -mmin -1 -print|grep -v 'part'|wc -l) if [ "$count" -gt 1 ] then echo "${RED}${blink}${bold}" echo 'WARNING!!! More then one Drive detected!!!' echo "${DEFAULT}" echo "$id" elif [ "$count" -eq 0 ] then echo "${RED}${blink}${bold}" echo 'WARNING!!! No New Drives Detected!!!' echo "${DEFAULT}" else echo "$id detected at:" readlink -f $id fi
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)