Jump to content
5 posts in this topic

Recommended Posts

#!/bin/sh

 

"$1/Contents/Resources/SetHidden" "$3" \

"$1/Contents/Resources/hidden_MacOS9"

 

 

if [ "x$CF_USER_DATA_STRING" != "x" ]; then

echo "$CF_USER_DATA_STRING" > "$3/var/root/.CFUserTextEncoding";

"$3/usr/sbin/chown" -f root:wheel "$3/var/root/.CFUserTextEncoding";

"$3/bin/chmod" -f 644 "$3/var/root/.CFUserTextEncoding";

fi

 

bless -mount "$3/" -setBoot

 

diskutil repairPermissions "$3/"

 

"$3/bin/chmod" -R 755 "$3/System/Library/Extensions/"

 

"$3/usr/sbin/chown" -R root:wheel "$3/System/Library/Extensions/"

 

"$1/Contents/Resources/SetHidden" "$3" \

"$1/Contents/Resources/hidden_MacOS9"

 

diskutil repairPermissions "$3/"

 

exit 0

 

alright so it must be something=$1? but the above code does not have that line. could you explain?

assuming the scripts name is "myscript.sh"

you would start it from the Terminal like this:

 

./myscript arg1 arg2 arg3

 

Within the script you could access those arguments with $1,$2 and $3

$0 is usually the name of the called executable, in this case myscript.sh

×
×
  • Create New...