Add scripts
This commit is contained in:
commit
f8e1b44a93
6
config/remove_subscription_warning.sh
Normal file
6
config/remove_subscription_warning.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Create backup and remove subscription warning from js file
|
||||
sed -Ezi.bak "s/(function\(orig_cmd\) \{)/\1\n\torig_cmd\(\);\n\treturn;/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
|
||||
|
||||
systemctl restart pveproxy.service
|
29
vm/create_from_template.sh
Normal file
29
vm/create_from_template.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
INPUT_FILE=$1
|
||||
|
||||
if [ -z "$INPUT_FILE" ]; then
|
||||
echo "Usage: $0 <path-to-input-file>"
|
||||
echo "Input file format:"
|
||||
echo -e "\tusername pool_name"
|
||||
echo -e "\tusername pool_name"
|
||||
echo -e "\t..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NEXT_VM_ID=202404101
|
||||
|
||||
TEMPLATE_VM_ID=202404001
|
||||
|
||||
while read -r line; do
|
||||
USERNAME=$(echo "$line" | awk '{print $1}')
|
||||
POOL_NAME=$(echo "$line" | awk '{print $2}')
|
||||
|
||||
echo "Creating VM for $USERNAME ($POOL_NAME)"
|
||||
|
||||
qm clone $TEMPLATE_VM_ID $NEXT_VM_ID --name "$USERNAME" --full false --pool $POOL_NAME
|
||||
|
||||
pvesh set /access/acl --path /vms/$NEXT_VM_ID --roles PVEVMUser --users "$USERNAME@arda.lan"
|
||||
|
||||
((NEXT_VM_ID++))
|
||||
done < "$INPUT_FILE"
|
Loading…
Reference in New Issue
Block a user