Code Monkey home page Code Monkey logo

shell_scripts's Introduction

shell_scripts

This project is just a collection of useful shell scripts that I have written.

This is licenced to you with the GPL 3 licence. See here - [https://www.gnu.org/licenses/gpl.txt] This licence means if you use and modify any of these files you are obliged to publish and licence your now-open-source code as GPL 3 too. Feel free to borrow and modify. If you do what you think is a good modification, please return it to me (i.e. pull request).

Thanks. Scot

contents

  • README.md - this file
  • LICENCE.txt - GPL v3
  • fix_mounts.sh - ensures autofs mounts are mounted by a user and not 'root'
  • org.autonomous.fixmounts.plist - a macOS plist which runs the fix_mounts every 15 secs

fix mounts

Put the fix_mounts.sh file somewhere safe. /Users/yourusername/bin is a good spot. Edit the top part of the shell file to customise it to your environment. See the comments in the file.

Put the org.autonomous.fixmounts.plist file in /Libraries/LaunchDaemons:

sudo cp org.autonomous.fixmounts.plist /Libraries/LaunchDaemons

sudo chmod 644 /Libraries/LaunchDaemons/org.autonomous.fixmounts.plist

sudo vi /Libraries/LaunchDaemons/org.autonomous.fixmounts.plist

    #(edit the 'ProgramArguments' string value /path/to/fix_mounts.sh 
    #to point to the path where you put the shell script, 
    #e.g. /Users/yourusername/bin/fix_mounts.sh)

sudo launchctl load /Library/LaunchDaemons/org.autonomous.fixmounts.plist 

sudo tail -F /var/log/fixmounts.log

	#(or view the log in /var/log/fixmounts.log with the Console)

shell_scripts's People

Contributors

scotartt avatar

Stargazers

 avatar Thomas Lovén avatar  avatar

Watchers

James Cloos avatar  avatar

shell_scripts's Issues

Does not work for multiple users?

Hi,

I tried to adapt your scripts to use them for multiple users on one MacBook.

  • I created /etc/auto_userid - files per user
  • mount points are in a subfolder in /Users/userid
  • there is a separate fix_mounts.sh for each user in /Users/userid/bin
  • there is a separate org.autonomous.fixmounts.userid.plist for each user in /Library/LaunchDaemons
  • I'm pretty sure I changed all necessary settings in the scripts and the plist files.

However, once a mount is not for the correct user, there are remounts carried out, but they are not necessarily for the correct user, but for any user the scripts/services are implemented.
Once I reduce the number of setups to one everything seems to be working OK.

Any ideas/suggestions?

Thanks,
Thomas

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.