Skip to content
Snippets Groups Projects
Commit 831e99e6 authored by Christian Rohlfing's avatar Christian Rohlfing
Browse files

Update rc.local.sh

parent a34ebf7f
No related branches found
No related tags found
1 merge request!2Develop
......@@ -116,6 +116,26 @@ for SWP in /mnt/localfs/*/mindstorms.swp; do
swapon "$SWP"
done
# Remove work directory if not mounted
if ! mountpoint -q /home/mindstorms/work; then
echo "Removing work directory as no available mountpoint found."
rm -rf /home/mindstorms/work
fi
# Try to find mindstorms.startup directory (also on boot medium) which should include hook.sh
echo "Looking for mindstorms.startup directory (also on boot medium) which should include hook.sh ..."
for DIR in /cdrom/mindstorms.startup /mnt/localfs/*/mindstorms.startup; do
[ -d "$DIR" ] || continue
echo "Found mindstorms.startup.dir at ${DIR}. Searching for hook.sh ..."
if [ ! -f "$DIR/hook.sh" ]; then
echo "File not found!" && continue
fi
# Execute hook as mindstorms user
su - mindstorms $DIR/hook.sh && break
done
# Try to unmount all unused partitions
echo "Unmounting all unused partitions ..."
for PART in /mnt/localfs/*; do
......@@ -123,12 +143,6 @@ for PART in /mnt/localfs/*; do
umount "$PART" 2>/dev/null
done
# Remove work directory if not mounted
if ! mountpoint -q /home/mindstorms/work; then
echo "Removing work directory as no available mountpoint found."
rm -rf /home/mindstorms/work
fi
# HACK: re-enable gnome's automount functionality.
echo "Re-enabling gnome's automount functionality ..."
su - mindstorms -c "dbus-launch --exit-with-session gsettings set org.gnome.desktop.media-handling automount 'true'"
......@@ -159,4 +173,3 @@ chmod +x /home/mindstorms/Desktop/matlab.desktop
sudo chown mindstorms:mindstorms /home/mindstorms/Desktop/matlab.desktop
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment