35 lines
911 B
Bash
35 lines
911 B
Bash
#! /bin/sh
|
|
# /etc/init.d/usbMount
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: usbMount
|
|
# Required-Start: $remote_fs $syslog
|
|
# Required-Stop: $remote_fs $syslog
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Simple script to start a program at boot
|
|
# Description: A simple script from www.stuffaboutcode.com which will start / stop a program a boot / shutdown.
|
|
### END INIT INFO
|
|
|
|
# If you want a command to always run, put it here
|
|
|
|
# Carry out specific functions when asked to by the system
|
|
case "$1" in
|
|
start)
|
|
echo "mounting USB /dev/sda1 to /usb/mnt"
|
|
# run application you want to start
|
|
sudo mount -o uid=poconsole,gid=poconsole /dev/sda1 /mnt/usb
|
|
;;
|
|
stop)
|
|
echo "unmounting /usb/mnt"
|
|
# kill application you want to stop
|
|
sudo umount /mnt/usb
|
|
;;
|
|
*)
|
|
echo "Usage: /etc/init.d/usbMount {start|stop}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|