@ -31,6 +31,7 @@ ${CL}"
}
}
header_info
header_info
function pve_7( ) {
function pve_7( ) {
if [ ` pveversion | grep "pve-manager/7" | wc -l` -ne 1 ] ; then
if [ ` pveversion | grep "pve-manager/7" | wc -l` -ne 1 ] ; then
echo -e " ${ RD } This script requires Proxmox Virtual Environment 7.0 or greater "
echo -e " ${ RD } This script requires Proxmox Virtual Environment 7.0 or greater "
@ -41,11 +42,11 @@ fi
}
}
function default_settings( ) {
function default_settings( ) {
clear
clear
header_info
header_info
echo -e " ${ BL } Using Default Settings ${ CL } "
echo -e " ${ BL } Using Default Settings ${ CL } "
echo -e " ${ GN } Using CT Type ${ BGN } Unprivileged ${ CL } "
echo -e " ${ GN } Using CT Type ${ BGN } Unprivileged ${ CL } "
CT_TYPE = "1"
CT_TYPE = "1"
echo -e " ${ GN } Using CT Password ${ BGN } Automatic Login ${ CL } "
echo -e " ${ GN } Using CT Password ${ BGN } Automatic Login ${ CL } "
PW = " "
PW = " "
echo -e " ${ GN } Using ID ${ BGN } $NEXTID ${ CL } "
echo -e " ${ GN } Using ID ${ BGN } $NEXTID ${ CL } "
@ -63,7 +64,7 @@ function default_settings() {
echo -e " ${ GN } Using IP Address ${ BGN } DHCP ${ CL } "
echo -e " ${ GN } Using IP Address ${ BGN } DHCP ${ CL } "
NET = dhcp
NET = dhcp
echo -e " ${ GN } Using VLAN Tag ${ BGN } NONE ${ CL } "
echo -e " ${ GN } Using VLAN Tag ${ BGN } NONE ${ CL } "
VLAN = " "
VLAN = " "
}
}
function advanced_settings( ) {
function advanced_settings( ) {
@ -75,7 +76,8 @@ function advanced_settings() {
if [ -z $CT_TYPE1 ] ; then CT_TYPE1 = "Unprivileged" CT_TYPE = "1" ;
if [ -z $CT_TYPE1 ] ; then CT_TYPE1 = "Unprivileged" CT_TYPE = "1" ;
echo -en " ${ GN } Set CT Type ${ BL } $CT_TYPE1 ${ CL } "
echo -en " ${ GN } Set CT Type ${ BL } $CT_TYPE1 ${ CL } "
else
else
CT_TYPE = "0"
CT_TYPE1 = "Privileged"
CT_TYPE = "0"
echo -en " ${ GN } Set CT Type ${ BL } Privileged ${ CL } "
echo -en " ${ GN } Set CT Type ${ BL } Privileged ${ CL } "
fi ;
fi ;
echo -e " ${ CM } ${ CL } \r "
echo -e " ${ CM } ${ CL } \r "
@ -270,20 +272,24 @@ function error_exit() {
[ ! -z ${ CTID - } ] && cleanup_ctid
[ ! -z ${ CTID - } ] && cleanup_ctid
exit $EXIT
exit $EXIT
}
}
function warn( ) {
function warn( ) {
local REASON = " \e[97m $1 \e[39m "
local REASON = " \e[97m $1 \e[39m "
local FLAG = "\e[93m[WARNING]\e[39m"
local FLAG = "\e[93m[WARNING]\e[39m"
msg " $FLAG $REASON "
msg " $FLAG $REASON "
}
}
function info( ) {
function info( ) {
local REASON = " $1 "
local REASON = " $1 "
local FLAG = "\e[36m[INFO]\e[39m"
local FLAG = "\e[36m[INFO]\e[39m"
msg " $FLAG $REASON "
msg " $FLAG $REASON "
}
}
function msg( ) {
function msg( ) {
local TEXT = " $1 "
local TEXT = " $1 "
echo -e " $TEXT "
echo -e " $TEXT "
}
}
function cleanup_ctid( ) {
function cleanup_ctid( ) {
if $( pct status $CTID & >/dev/null) ; then
if $( pct status $CTID & >/dev/null) ; then
if [ " $( pct status $CTID | awk '{print $2}' ) " = = "running" ] ; then
if [ " $( pct status $CTID | awk '{print $2}' ) " = = "running" ] ; then
@ -294,11 +300,13 @@ function cleanup_ctid() {
pvesm free $ROOTFS
pvesm free $ROOTFS
fi
fi
}
}
function cleanup( ) {
function cleanup( ) {
popd >/dev/null
popd >/dev/null
rm -rf $TEMP_DIR
rm -rf $TEMP_DIR
}
}
if [ " $CT_TYPE " = = "1" ] ; then
if [ " $CT_TYPE " = = "1" ] ; then
FEATURES = "nesting=1,keyctl=1"
FEATURES = "nesting=1,keyctl=1"
else
else
FEATURES = "nesting=1"
FEATURES = "nesting=1"