- Gäst
- Oregistrerad ●
- 2005-05-04 21:07
hej, jag försöker köra ett shellscript och få det att fungera, jag kan inte skriva själv utan använder ett färdigt från http://www.bombich.com/mactips/files/scripts/refresh-default-homedir.sh
jag använde dessa instruktioner.
Before you get too in depth here, check out my LoginWindow Manager. LWM is a GUI replacement for steps 3, 4, and 5.
Create a shell script to be run upon login. The name of the script is not important, as long as it is the same as what you will indicate in step 4. Note that the name of the user logging in is sent as an argument ($1) to this script. You can also download this basic script and copy it to /Library/Management (you may have to create this folder). Be sure to check out my Scripts Library for several other scripts that perform various tasks.
Make sure this script is executable with a Terminal command such as:
sudo chmod u+x /Library/Management/login.sh
Test that the script will actually work. To do this, type this in the Terminal:
sudo /Library/Management/login.sh username
Change "username" to an actual user on the system. Check that the script did what you expected it to do and ran without errors. Errors may cause login to hang or not complete at all.
Launch the Terminal application. Type:
sudo defaults write /Library/Preferences/com.apple.loginwindow LoginHook /Library/Management/login.sh
Logout and log back in to make sure the script has been implemented properly.
I scriptet finns även dessa instruktioner -
### Description ###
#
# This script removes a default user home directory and replaces
# it with a fresh copy from a template. If the home directory
# specified for the user logging in is not the default directory
# that you indicate below, their user directory will not be affected
# That is, this script only affects users whose home directory is
# specified in the defHome variable.
# This script assumes that you want to manage users that all have
# the same home directory specified in NetInfo or LDAP.
### Properties ###
#
# These items must be modified to suit your environment before
# implementing this script! You do not need to make any other
# modifications to this file than these properties.
#
# defGrp: the group that your default user is assigned to
# defHome: the location of your default user's home directory
# defTemplate: the location of your default user home dir template
set defGrp = staff
set defHome = /Users/default
set defTemplate = /Library/Management/default
set localAdmin = admin
kontot jag vill applicera scriptet på heter "svenska"
jag antar därför att alla parametrar ska va satta till svenska?, samt att den "template" som ska laddas ska vara en kopia av svenska´s hemmamapp som jag lagt under
/library/management/svenska
såhär har jag skrivit i scriptet
defGrp = svenska
defHome = /user/svenska
defTemplate = library/management/svenska
set localAdmin = admin (det här vet jag inte riktigt vad jag ska skriva?)
problemet blir att när jag loggar in på kontot "svenska" så har inte kontot rättigheter till sin hemmamapp, vilket inte ska va fallet, taken med scriptet är ju att användaren ska mer eller mindre kunna ställa till en riktig oreda eftersom mappen tas bort och kopierars över med en mall mapp när nästa användare ska logga in.. vad gör jag för fel, hur ger jag kontot "rätt" skriv och läs rättigheter?