Skip to content

Commit

Permalink
Update all references to HOME with ZUSERHOME and move ZUSERHOME to vz…
Browse files Browse the repository at this point in the history
…vol main script for early initialization
  • Loading branch information
RainbowHackerHorse committed May 30, 2018
1 parent 8f4db32 commit b329822
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions bin/vzvol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ VOLTYPE=NULL
vzvol_libdir=/usr/local/lib/vzvol/lib
vzvol_gitdir=$( find ./ -name "vzvol" | grep bin | sed 's/.\{10\}$//' )
ZUSER="$(logname)"
ZUSERHOME=$( awk -F ":" '/${ZUSER}/{print $6}' < /etc/passwd )


if [ ! "$(whoami)" = 'root' ]; then
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/vzvol_getargz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ vzvol_getargz() {
return 1
else
DELETE_ME="${2}"
DELETE_VMDK="${HOME}/VBoxDisks/${2}.vmdk"
DELETE_VMDK="${ZUSERHOME}/VBoxDisks/${2}.vmdk"
vzvol_delete || exit 1
exit
fi
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/vzvol_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ vzvol_list_type() {
else
zvolfstype="unknown"
fi
if [ -f "${HOME}/VBoxdisks/${purevolname}.vmdk" ]; then
echo "${vols} VirtualBox ${HOME}/VBoxdisks/${purevolname}.vmdk $purevolused $purevolsize $zvolfstype"
if [ -f "${ZUSERHOME}/VBoxdisks/${purevolname}.vmdk" ]; then
echo "${vols} VirtualBox ${ZUSERHOME}/VBoxdisks/${purevolname}.vmdk $purevolused $purevolsize $zvolfstype"
else
echo "${vols} RAW none $purevolused $purevolsize $zvolfstype"
fi
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/vzvol_type.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ zvol_type_virtualbox() {
errorfunc='zvol_type_virtualbox'
zvol_create || return 1
vmdk_create || return 1
echo "Please use ${HOME}/VBoxdisks/${VOLNAME}.vmdk as your VM Disk"
echo "Please use ${ZUSERHOME}/VBoxdisks/${VOLNAME}.vmdk as your VM Disk"
}
zvol_type_raw() {
errorfunc='zvol_type_raw'
Expand Down
1 change: 0 additions & 1 deletion lib/shared/vzvol_vmdk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh
vmdk_create() {
ZUSERHOME=$( awk -F ":" '/${ZUSER}/{print $6}' < /etc/passwd )
errorfunc='vmdk_create'
if [ ! -d "${ZUSERHOME}"/VBoxdisks/ ]; then
mkdir -p "${ZUSERHOME}"/VBoxdisks/
Expand Down

0 comments on commit b329822

Please sign in to comment.