Last active
May 27, 2016 07:29
-
-
Save sergey-dryabzhinsky/e3f5a64589f1a39b8dabb0dc10dbba4e to your computer and use it in GitHub Desktop.
OpenVZ container umount script with space quoting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### | |
# More advanced on-umount script for OpenVZ container | |
# Based on https://openvz.org/Bind_mounts | |
# | |
# 1. Set quotas off | |
# | |
[ -f /etc/vz/vz.conf ] || exit 1 | |
[ -f $VE_CONFFILE ] || exit 1 | |
. /etc/vz/vz.conf | |
. ${VE_CONFFILE} | |
# Do not need quotas? Then uncomment: | |
#exit 0 | |
# Quota ID, make it real BIG number, to avoid crossing with container root VEID | |
QID=$((VEID+1000000)) | |
vzquota show $QID >/dev/null 2>/dev/null | |
if [ $? -ne 0 ]; then | |
# Quotas OFF | |
vzquota off $QID | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment