![]() |
meh - just re-saved it using LF for line endings and UTF8 for encoding with TextMate and got this:
Code:
WuWei:Desktop fudog$ sudo ./hadmin.sh hadmin hadminsame result with #!/bin/bash as well |
Quote:
http://macromates.com/ I can grab textwrangler and give that a go - but I dont think thats the problem now, unfortunately (I wish it was that simple). But I'll try it anyway just in case |
Quote:
Code:
sudo sh ~/Desktop/myscript.sh |
just tried it with TextWrangler and got the same results. booo
|
Quote:
same result mate. "Command not found" I've done ls -l and I can see it there via the terminal |
OK, lets get some fundamentals here as this thread is old. I know hidden user scripts work because I use them daily when imaging macs at my work.
Please answer the following: 1) What OS X version are you running? 2) what is the exact script are you running? 3) Does any other script work, or is it just this one that is broken? Thanks |
Os x 10.6.4
the script I'm running is this: Code:
#!/bin/shI just tried this (test.sh): Code:
cd /and received the same problem - so that gives us some info |
I think i fixed it with:
chmod +x test.sh |
so this is the result I got in terminal
Code:
WuWei:Desktop fudog$ sudo ./hadmin.sh hadmin hadminI can see a new user in preferences, but it has no name (even though I gave the variable called 'hadmin'). I was hoping to not see a user in there, the point being that its invisible. Also Im trying to find the home directory for this new user. I cant find /Local/Default/ - if that is indeed where its meant to be? thanks for your help so far mate - learning lots here. [edit] oh I see its meant to be in /var/ |
Confirmed, there is a new home directory for my user in /var/home/
|
thats interesting. Although I can see the new user in preferences. It has no name and is just labeled as an admin. But I cant delete the user.
hmmm that because it is root. hmm thats not right, root is visible in my preferences now. odd |
well if it is 10.6 you can get rid of a lot of that code since you definitely do not need netinfo.
Here is a make-shift one you can try for testing purposes Code:
#!/bin/bash |
the orginal script had this in it
if [ -z $GROUPID ] || [ -z $UNIQUEID ] ; then GROUPID=0 UNIQUEID=0 would I be right in thinking that groupid=0 uniqueid=0 is the same as root... so the new user I created is conflicting with root? |
I'll have a crack later, in deleting this user i just created and start over ;-) - I need to go have some lunch ;D
thanks for the help |
Quote:
|
OK I slightly amended your script
Code:
#!/bin/bash#!/bin/bash (just a typo) UID to UniqID (had to change this variable, the script wouldnt run with the UID, it is a read only variable) homefolder="/private/var/home" (this path, I wanted the home dir to be created in home inside var) It seem to run ok accept that I think the home dir didnt create. Although I was able to log in with this user there is no home dir visible when logged in. And when I physically look in var/home/ there is nothing in it. cheers |
I think that by nature home directories create on the fly at first log in. So the home folder may not exist until you actually log in.
Glad that worked for you. I only had about 3 minutes of free time so I just typed that out as fast as I could. Now back to work...as my lunch break is now over. |
ok I fixed it by creating another script:
Code:
/bin/mkdir -p /var/home/hadmin |
Quote:
|
This is where directory services local differs from server side I guess. Server side it creates on the fly when you first log in. Technically if this is for local administration and remote admin connection you don't need a home folder per se, but yeah I get it.
Copying the contents of the user template to the home folder will in fact create the desktop, documents, etc folders. Which is most likely what the server side does under the hood for you if you change anything in particular. I will have to modify my create user scripts to add options for home folders. Thanks, Tom |
| All times are GMT -5. The time now is 05:31 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.