Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash
REMOUNT_DIR="/data"
HELP_MSG="Please choose how to remount ${REMOUNT_DIR}: 'ro' or 'rw'."
if [ -z "$1" ]; then
echo "${HELP_MSG}"
exit
fi
if [ "ro" = "$1" ]; then
echo "Remounting ${REMOUNT_DIR} read-only"
sudo mount -o remount,ro "${REMOUNT_DIR}"
exit
fi
if [ "rw" = "$1" ]; then
echo "Remounting ${REMOUNT_DIR} read-write"
sudo mount -o remount,rw "${REMOUNT_DIR}"
exit
fi
echo "${HELP_MSG}"