This commit is contained in:
T. Joseph Carter
2015-10-09 05:52:17 -07:00
12 changed files with 289 additions and 277 deletions
+5 -4
View File
@@ -1,4 +1,5 @@
#!/bin/bash
#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
# afpsync: updates .AppleDouble components of files on shared volumes
@@ -45,12 +46,12 @@ processPath () {
[[ ! $renameLower ]] && echo "Ensure filenames are all caps on volume $sharepath."
if [[ $showerrors ]]; then
echo $result \
| while read LINE; do
| while read LINE; do
[[ ! $(echo $LINE | grep APPLEDESKTOP) ]] && echo $LINE
done
elif [[ $renameLower ]]; then
echo $result \
| while read LINE; do
| while read LINE; do
if [[ ! $(echo $LINE | grep APPLEDESKTOP) ]]; then
filepath=$(echo $LINE | sed "s/^Bad\ encoding\ for\ '//" | sed s/\'//)
filename=${filepath##*/}
@@ -105,7 +106,7 @@ else
processPath
else
grep ^/media /usr/local/etc/netatalk/AppleVolumes.default | \
while read line; do
while read line; do
[[ $(echo $line | grep toupper) ]]; nocasefold=$?
sharepath=$(echo $line | cut -d" " -f1)
processPath nocasefold
+33 -33
View File
@@ -1,4 +1,5 @@
#!/bin/bash
#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
# 2-25-11: tested on 10.6.5 and Ubuntu 10.10. Final.
@@ -58,7 +59,7 @@ decToHex () {
[[ $1 ]] || return 11
[[ $2 ]] && return 8
[[ ( $(printf %d "$1" 2> /dev/null) == $1 ) \
&& ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21
&& ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21
# args are valid
printf %02X "$1"
}
@@ -72,7 +73,7 @@ hexToDec () {
[[ $2 ]] && return 8
[[ ${#1} -eq 2 ]] || return 21
[[ $(printf %02X "0x$1" 2> /dev/null) == \
$(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 21
$(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 21
# args are valid
printf %d "0x$1"
}
@@ -92,7 +93,7 @@ charToDec () {
# above line verifies that arg/stdin is valid
[[ ${#charX} -ne 2 ]] && { echo -n 0; return 0; }
echo -n "${charX:0:1}" | od -t u1 | \
head -1 | sed 's/[0\ ]*//' | tr -d ' \n'
head -1 | sed 's/[0\ ]*//' | tr -d ' \n'
}
charToHex () {
@@ -110,7 +111,7 @@ charToHex () {
# above line verifies that stdin/arg is valid
[[ ${#charX} -ne 2 ]] && { echo -n "00"; return 0; }
printf %02X $(echo -n "${charX:0:1}" | od -t u1 | \
head -1 | sed 's/[0\ ]*//' | tr -d ' \n')
head -1 | sed 's/[0\ ]*//' | tr -d ' \n')
}
decToChar () {
@@ -121,7 +122,7 @@ decToChar () {
[[ $1 ]] || return 11
[[ $2 ]] && return 8
[[ ( $(printf %d "$1" 2> /dev/null ) == $1 ) \
&& ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21
&& ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21
# args are valid
echo -n -e "\x$(printf %02X "$1")"
}
@@ -135,7 +136,7 @@ hexToChar () {
[[ $2 ]] && return 8
[[ ${#1} -eq 2 ]] || return 21
[[ $(printf %02X "0x$1" 2> /dev/null) == \
$(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 21
$(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 21
# args are valid
echo -n -e "\x$1"
}
@@ -152,12 +153,12 @@ readchars () {
[[ $4 ]] && return 8
[[ -f $1 ]] || return 21
[[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \
&& ( $2 -ge 0 ) ]] || return 22; }
&& ( $2 -ge 0 ) ]] || return 22; }
[[ $3 ]] && { [[ ( $(printf %d "$3" 2> /dev/null) == $3 ) \
&& ( $3 -ge 0 ) ]] || return 23; }
&& ( $3 -ge 0 ) ]] || return 23; }
# args are valid
dd if="$1" bs=1 skip=$(($2)) $([[ $3 ]] && echo -n "count=$3") \
2> /dev/null
2> /dev/null
}
readcharDec () {
@@ -171,13 +172,13 @@ readcharDec () {
[[ $3 ]] && return 8
[[ -f $1 ]] || return 21
[[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \
&& ( $2 -ge 0 ) ]] || return 22; }
&& ( $2 -ge 0 ) ]] || return 22; }
# args are valid
charX="$(dd if="$1" bs=1 skip=$(($2)) \
count=1 2> /dev/null; echo -n X)"
count=1 2> /dev/null; echo -n X)"
[[ ${#charX} -gt 1 ]] || { echo -n 0; return 0; }
echo -n "${charX:0:1}" | od -t u1 | \
head -1 | sed 's/[0\ ]*//' | tr -d ' \n'
head -1 | sed 's/[0\ ]*//' | tr -d ' \n'
}
readcharHex () {
@@ -191,13 +192,13 @@ readcharHex () {
[[ $3 ]] && return 8
[[ -f $1 ]] || return 21
[[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \
&& ( $2 -ge 0 ) ]] || return 22; }
&& ( $2 -ge 0 ) ]] || return 22; }
# args are valid
charX="$(dd if="$1" bs=1 skip=$(($2)) \
count=1 2> /dev/null; echo -n X)"
count=1 2> /dev/null; echo -n X)"
[[ ${#charX} -gt 1 ]] || { echo -n "00"; return 0; }
printf %02X $(echo -n "${charX:0:1}" | od -t u1 | \
head -1 | sed 's/[0\ ]*//' | tr -d ' \n')
head -1 | sed 's/[0\ ]*//' | tr -d ' \n')
}
### 2-15-11 above tested on OS X and Linux
@@ -213,13 +214,13 @@ writechars () {
# 13=missing stdin/arg3, 22=invalid arg2
[[ $1 ]] || { [[ -t 0 ]] || cat > /dev/null; return 11; }
[[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) && \
( $2 -ge 0 ) ]] || { [[ -t 0 ]] || cat > /dev/null; return 22; } }
( $2 -ge 0 ) ]] || { [[ -t 0 ]] || cat > /dev/null; return 22; } }
[[ ( ! -t 0 ) && $3 ]] && { cat > /dev/null; return 8; }
[[ ( -t 0 ) ]] && { [[ $4 ]] && return 8; [[ $3 ]] || return 13; }
# args are valid
if [[ -t 0 ]]; then
echo -n "$3" | \
dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null
dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null
else
dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null
fi
@@ -236,12 +237,12 @@ writecharDec () {
[[ $1 ]] || return 11; [[ $2 ]] || return 12; [[ $3 ]] || return 13
[[ $4 ]] && return 8
[[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \
&& ( $2 -ge 0 ) ]] || return 22
&& ( $2 -ge 0 ) ]] || return 22
[[ ( $(printf %d "$3" 2> /dev/null) == $3 ) \
&& ( $3 -ge 0 ) && ( $3 -lt 255 ) ]] || return 23
&& ( $3 -ge 0 ) && ( $3 -lt 255 ) ]] || return 23
# args are valid
echo -n -e "\x$(printf %02X "$3")" | \
dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null
dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null
}
writecharHex () {
@@ -255,12 +256,12 @@ writecharHex () {
[[ $1 ]] || return 11; [[ $2 ]] || return 12; [[ $3 ]] || return 13
[[ $4 ]] && return 8
[[ ( $(printf %d "$2" 2> /dev/null) == $2 ) \
&& ( $2 -ge 0 ) ]] || return 22
&& ( $2 -ge 0 ) ]] || return 22
[[ $(printf %02X "0x$3" 2> /dev/null) == \
$(echo -n "$3" | tr [a-z] [A-Z]) ]] || return 23
$(echo -n "$3" | tr [a-z] [A-Z]) ]] || return 23
# args are valid
echo -n -e "\x$3" | \
dd of="$1" bs=1 seek=$2 conv=notrunc 2> /dev/null
dd of="$1" bs=1 seek=$2 conv=notrunc 2> /dev/null
}
@@ -268,7 +269,7 @@ writecharHex () {
isHexByte () {
[[ $(printf %02X "0x$1" 2> /dev/null) == \
$(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 1
$(echo -n "$1" | tr [a-z] [A-Z]) ]] || return 1
}
# support 00 and 0A as filetype chars?
@@ -310,8 +311,7 @@ lookupPdosType () {
[[ ${#1} -eq 3 ]] || return 1
arg=$(echo -n "$1" | tr [a-z] [A-Z])
for ptype in $ptypes; do
if [[ ${ptype:3:3} == $arg ]]
then
if [[ ${ptype:3:3} == $arg ]]; then
echo -n "${ptype:0:2}"
return 0
fi
@@ -383,11 +383,11 @@ for filename in $@; do
[[ -f $adname ]] && filename=$adname
ADversion=$(readcharDec "$filename" 5)
if [[ ( ( $ADversion -ne 1 ) && ( $ADversion -ne 2 ) ) \
|| ( "$(readchars "$filename" 1 3)" != "$(echo -e -n "\x05\x16\x07")" ) \
|| ( $(readcharDec "$filename" 0) -ne 0 ) \
|| ( $(readcharDec "$filename" 4) -ne 0 ) \
|| ( $(readcharDec "$filename" 6) -ne 0 ) \
|| ( $(readcharDec "$filename" 7) -ne 0 ) ]]; then
|| ( "$(readchars "$filename" 1 3)" != "$(echo -e -n "\x05\x16\x07")" ) \
|| ( $(readcharDec "$filename" 0) -ne 0 ) \
|| ( $(readcharDec "$filename" 4) -ne 0 ) \
|| ( $(readcharDec "$filename" 6) -ne 0 ) \
|| ( $(readcharDec "$filename" 7) -ne 0 ) ]]; then
echo "${linestart}Not an AppleDouble file."
continue
fi
@@ -451,7 +451,7 @@ for filename in $@; do
echo -n "$linestart"
if [[ $creator != "pdos" || ( ( $type != "TEXT" ) \
&& ( $type != "PSYS" ) && ( ${type:0:1} != "p" ) ) ]]; then
&& ( $type != "PSYS" ) && ( ${type:0:1} != "p" ) ) ]]; then
if [[ $creator || $type ]]; then
echo "Mac file. Type:$type Creator:$creator"
else
+185 -184
View File
@@ -1,4 +1,5 @@
#!/bin/bash
#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
# mkatinit by Ivan Drucker, http://appleii.ivanx.com
# not licensed; please modify and redistribute as you like
@@ -29,7 +30,7 @@ decToChar () {
[[ $1 ]] || return 11
[[ $2 ]] && return 8
[[ ( $(printf %d "$1" 2> /dev/null ) == $1 ) \
&& ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21
&& ( $1 -ge 0 ) && ( $1 -le 255 ) ]] || return 21
# args are valid
echo -n -e "\x$(printf %02X "$1")"
}
@@ -45,13 +46,13 @@ writechars () {
# 13=missing stdin/arg3, 22=invalid arg2
[[ $1 ]] || { [[ -t 0 ]] || cat > /dev/null; return 11; }
[[ $2 ]] && { [[ ( $(printf %d "$2" 2> /dev/null) == $2 ) && \
( $2 -ge 0 ) ]] || { [[ -t 0 ]] || cat > /dev/null; return 22; } }
( $2 -ge 0 ) ]] || { [[ -t 0 ]] || cat > /dev/null; return 22; } }
[[ ( ! -t 0 ) && $3 ]] && { cat > /dev/null; return 8; }
[[ ( -t 0 ) ]] && { [[ $4 ]] && return 8; [[ $3 ]] || return 13; }
# args are valid
if [[ -t 0 ]]; then
echo -n "$3" | \
dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null
dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null
else
dd of="$1" bs=1 seek=$(($2)) conv=notrunc 2> /dev/null
fi
@@ -73,49 +74,49 @@ echo
usersfolder=1
while [ -n "$1" ] && [ "${1:0:1}" = '-' ]; do
flag="$1"
if [ $flag = "-gs" ]; then
gs=1
shift
continue
elif [ $flag = "-d" ]; then
noprompt=1
shift
continue
elif [ $flag = "-f" ]; then
overwrite=1
shift
continue
elif [ $flag = "-g" ]; then
alsoguest=1
shift
continue
elif [ $flag = "-c" ]; then
usersfolder=0
shift
continue
else
badflag=1
break
fi
flag="$1"
if [ $flag = "-gs" ]; then
gs=1
shift
continue
elif [ $flag = "-d" ]; then
noprompt=1
shift
continue
elif [ $flag = "-f" ]; then
overwrite=1
shift
continue
elif [ $flag = "-g" ]; then
alsoguest=1
shift
continue
elif [ $flag = "-c" ]; then
usersfolder=0
shift
continue
else
badflag=1
break
fi
done
if [ $usersfolder -eq 0 ] && [ -n "$alsoguest" ]; then
badflag=1
badflag=1
fi
if [ $badflag ]; then
echo "usage: mkatinit [-gs] [-d] [-f] [-g | -c] [<username>|guest]"
echo
echo "<username> should be the name of a netatalk user, or 'guest'"
echo "-gs sets the default ProDOS netboot system startup program and"
echo " prefix for GS/OS (if omitted, ProDOS 8 defaults are used)"
echo "-d use the default start program and prefix, without prompting"
echo "-f overwrite existing ATINIT file if present, without warning"
echo "-g create an ATINIT file for Guest as well as the specified user"
echo "-c write ATNIT to current directory instead of USERS hierarchy"
echo
exit
echo "usage: mkatinit [-gs] [-d] [-f] [-g | -c] [<username>|guest]"
echo
echo "<username> should be the name of a netatalk user, or 'guest'"
echo "-gs sets the default ProDOS netboot system startup program and"
echo " prefix for GS/OS (if omitted, ProDOS 8 defaults are used)"
echo "-d use the default start program and prefix, without prompting"
echo "-f overwrite existing ATINIT file if present, without warning"
echo "-g create an ATINIT file for Guest as well as the specified user"
echo "-c write ATNIT to current directory instead of USERS hierarchy"
echo
exit
fi
arg="$1"
@@ -124,162 +125,162 @@ arg="$1"
while : ; do
if [ ${#arg} -gt 32 ]; then
echo "User name is too long. Exiting with no action."
exit
elif [ -n "$arg" ]; then
if [ `echo $arg | tr '[:upper:]' '[:lower:]'` = "guest" ]; then
username='<Any User>'
alsoguest=
if [[ ! $(grep -F -s $(ls -1 /home) /etc/default/netatalk) ]]; then
echo 'Warning: The AFPD_GUEST setting in /etc/default/netatalk is not assigned to a'
echo 'user with a folder in /home. Guest users may be able to boot over the network'
echo 'into ProDOS 8 for read-only access, but will not be able to boot into GS/OS.'
if [ $gs ]; then
echo ' Using ProDOS 8 defaults.'
gs=
else
echo
fi
echo
fi
else
username="$arg"
if [[ ! $(ls -1 /home | grep -F -s $username) ]]; then
echo "Warning: This username ($username) does not have a folder in /home. This user may"
echo "not be able to boot over the network into ProDOS 8 or GS/OS."
echo
fi
fi
if [ $gs ]; then
startprog="$gsstartprog"
prefix="$gsprefix"
fi
fi
if [ ${#arg} -gt 32 ]; then
echo "User name is too long. Exiting with no action."
exit
elif [ -n "$arg" ]; then
if [ `echo $arg | tr '[:upper:]' '[:lower:]'` = "guest" ]; then
username='<Any User>'
alsoguest=
if [[ ! $(grep -F -s $(ls -1 /home) /etc/default/netatalk) ]]; then
echo 'Warning: The AFPD_GUEST setting in /etc/default/netatalk is not assigned to a'
echo 'user with a folder in /home. Guest users may be able to boot over the network'
echo 'into ProDOS 8 for read-only access, but will not be able to boot into GS/OS.'
if [ $gs ]; then
echo ' Using ProDOS 8 defaults.'
gs=
else
echo
fi
echo
fi
else
username="$arg"
if [[ ! $(ls -1 /home | grep -F -s $username) ]]; then
echo "Warning: This username ($username) does not have a folder in /home. This user may"
echo "not be able to boot over the network into ProDOS 8 or GS/OS."
echo
fi
fi
if [ $gs ]; then
startprog="$gsstartprog"
prefix="$gsprefix"
fi
fi
# make username all caps
username=`echo $username | tr '[:lower:]' '[:upper:]'`
# make username all caps
username=`echo $username | tr '[:lower:]' '[:upper:]'`
# prompt for folders
if [ ! $doalsoguest ] && [ ! $noprompt ]; then
while : ; do
echo "Enter the ProDOS path to the startup system program."
echo "default (CR to accept): $startprog"
read
if [ ${#REPLY} -gt 64 ]; then
continue
elif [ -n "$REPLY" ]; then
startprog="`echo $REPLY | tr '[:lower:]' '[:upper:]'`"
echo
fi
break
done
# prompt for folders
if [ ! $doalsoguest ] && [ ! $noprompt ]; then
while : ; do
echo "Enter the ProDOS path to the startup system program."
echo "default (CR to accept): $startprog"
read
if [ ${#REPLY} -gt 64 ]; then
continue
elif [ -n "$REPLY" ]; then
startprog="`echo $REPLY | tr '[:lower:]' '[:upper:]'`"
echo
fi
break
done
while : ; do
echo "Enter the initial ProDOS prefix:"
echo "default (CR to accept): $prefix"
read
if [ ${#REPLY} -gt 64 ]; then
continue
elif [ -n "$REPLY" ]; then
prefix="`echo $REPLY | tr '[:lower:]' '[:upper:]'`"
echo
fi
break
done
fi
while : ; do
echo "Enter the initial ProDOS prefix:"
echo "default (CR to accept): $prefix"
read
if [ ${#REPLY} -gt 64 ]; then
continue
elif [ -n "$REPLY" ]; then
prefix="`echo $REPLY | tr '[:lower:]' '[:upper:]'`"
echo
fi
break
done
fi
# create folders if needed
filepath="$PWD/$filename"
# create folders if needed
filepath="$PWD/$filename"
while [ $usersfolder -eq 1 ]; do
# create folders for ATINIT
while [ ! -d "$sharepath" ]; do
echo "Shared volume '$sharepath' not found. Edit mkatinit to change the default."
echo "Enter the local path to the netatalk shared volume used for netboot:"
read sharepath
done
while [ $usersfolder -eq 1 ]; do
# create folders for ATINIT
while [ ! -d "$sharepath" ]; do
echo "Shared volume '$sharepath' not found. Edit mkatinit to change the default."
echo "Enter the local path to the netatalk shared volume used for netboot:"
read sharepath
done
if [ ! -d "$sharepath/USERS" ]; then
mkdir "$sharepath/USERS"
if [ $? -ne 0 ]; then
break
fi
fi
if [ ! -d "$sharepath/USERS/$username" ]; then
mkdir "$sharepath/USERS/$username"
if [ $? -ne 0 ]; then
break
fi
fi
if [ ! -d "$sharepath/USERS/$username/SETUP" ]; then
mkdir "$sharepath/USERS/$username/SETUP"
if [ $? -ne 0 ]; then
break
fi
else
if [ ! -w "$sharepath/USERS/$username/SETUP" ]; then
break
fi
fi
if [ ! -d "$sharepath/USERS" ]; then
mkdir "$sharepath/USERS"
if [ $? -ne 0 ]; then
break
fi
fi
if [ ! -d "$sharepath/USERS/$username" ]; then
mkdir "$sharepath/USERS/$username"
if [ $? -ne 0 ]; then
break
fi
fi
if [ ! -d "$sharepath/USERS/$username/SETUP" ]; then
mkdir "$sharepath/USERS/$username/SETUP"
if [ $? -ne 0 ]; then
break
fi
else
if [ ! -w "$sharepath/USERS/$username/SETUP" ]; then
break
fi
fi
# we have a valid USERS folder target for ATINIT
filepath="$sharepath/USERS/$username/SETUP/$filename"
usersfolder=2
done
# we have a valid USERS folder target for ATINIT
filepath="$sharepath/USERS/$username/SETUP/$filename"
usersfolder=2
done
if [ $usersfolder -eq 1 ]; then
echo "Could not write to shared volume. Creating ATINIT in current directory."
if [ -n "$alsoguest" ]; then
echo "ATINIT for Guest user will not be created."
fi
echo
alsoguest=
fi
if [ $usersfolder -eq 1 ]; then
echo "Could not write to shared volume. Creating ATINIT in current directory."
if [ -n "$alsoguest" ]; then
echo "ATINIT for Guest user will not be created."
fi
echo
alsoguest=
fi
if [ ! $doalsoguest ]; then
echo "netboot start program: $startprog"
echo "netboot start prefix : $prefix"
echo
fi
if [ ! $doalsoguest ]; then
echo "netboot start program: $startprog"
echo "netboot start prefix : $prefix"
echo
fi
#remove ATINIT if present
if [ ! $overwrite ] && [ -f "$filepath" ]; then
echo -n "$filepath already exists. Overwrite? "
while read -s -n 1 > /dev/null 2>&1; do
if [ -z "$REPLY" ]; then
continue
elif [ "$REPLY" = "Y" ] || [ "$REPLY" = "y" ]; then
echo
break
elif [ "$REPLY" = "N" ] || [ "$REPLY" = "n" ]; then
echo
echo "Exiting with no action."
exit
fi
done
fi
#remove ATINIT if present
if [ ! $overwrite ] && [ -f "$filepath" ]; then
echo -n "$filepath already exists. Overwrite? "
while read -s -n 1 > /dev/null 2>&1; do
if [ -z "$REPLY" ]; then
continue
elif [ "$REPLY" = "Y" ] || [ "$REPLY" = "y" ]; then
echo
break
elif [ "$REPLY" = "N" ] || [ "$REPLY" = "n" ]; then
echo
echo "Exiting with no action."
exit
fi
done
fi
#write the file. start with zeroes
dd if=/dev/zero of="$filepath" bs=1 count=276 2> /dev/null
#put in startprog, prefix, username (first byte of each field is length)
# ( echo -n "${#startprog}" | awk '{printf("%c",$0);}'; echo -n "$startprog"; ) | dd of="$filepath" bs=1 seek=7 conv=notrunc 2> /dev/null
# ( echo -n "${#prefix}" | awk '{printf("%c",$0);}'; echo -n "$prefix"; ) | dd of="$filepath" bs=1 seek=78 conv=notrunc 2> /dev/null
# ( echo -n "${#username}" | awk '{printf("%c",$0);}'; echo -n "$username"; ) | dd of="$filepath" bs=1 seek=143 conv=notrunc 2> /dev/null
( decToChar "${#startprog}"; echo -n "$startprog"; ) | writechars "$filepath" 7
( decToChar "${#prefix}"; echo -n "$prefix"; ) | writechars "$filepath" 78
( decToChar "${#username}"; echo -n "$username"; ) | writechars "$filepath" 143
#write the file. start with zeroes
dd if=/dev/zero of="$filepath" bs=1 count=276 2> /dev/null
#put in startprog, prefix, username (first byte of each field is length)
# ( echo -n "${#startprog}" | awk '{printf("%c",$0);}'; echo -n "$startprog"; ) | dd of="$filepath" bs=1 seek=7 conv=notrunc 2> /dev/null
# ( echo -n "${#prefix}" | awk '{printf("%c",$0);}'; echo -n "$prefix"; ) | dd of="$filepath" bs=1 seek=78 conv=notrunc 2> /dev/null
# ( echo -n "${#username}" | awk '{printf("%c",$0);}'; echo -n "$username"; ) | dd of="$filepath" bs=1 seek=143 conv=notrunc 2> /dev/null
( decToChar "${#startprog}"; echo -n "$startprog"; ) | writechars "$filepath" 7
( decToChar "${#prefix}"; echo -n "$prefix"; ) | writechars "$filepath" 78
( decToChar "${#username}"; echo -n "$username"; ) | writechars "$filepath" 143
echo "Created $filepath"
if [ ! $alsoguest ]; then
break
fi
echo "Created $filepath"
if [ ! $alsoguest ]; then
break
fi
if [ $usersfolder -eq 2 ]; then
usersfolder=1
fi
doalsoguest=1
arg='guest'
if [ $usersfolder -eq 2 ]; then
usersfolder=1
fi
doalsoguest=1
arg='guest'
done
echo
+2 -1
View File
@@ -1,4 +1,5 @@
#!/bin/bash
#! /bin/bash
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
# mkvolinfo -- creates a (share)/.AppleDesktop/.volinfo file