mirror of
https://github.com/flynx/proxmox-utils.git
synced 2025-10-29 19:20:10 +00:00
oops...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2d72bebc1a
commit
b226cb9780
@ -1,93 +1,93 @@
|
|||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
PATH=$PATH:$(dirname "$(pwd)")
|
PATH=$PATH:$(dirname "$(pwd)")
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
source ../.pct-helpers
|
source ../.pct-helpers
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
[ -e ../config.global ] \
|
[ -e ../config.global ] \
|
||||||
&& source ../config.global
|
&& source ../config.global
|
||||||
|
|
||||||
[ -e ./config ] \
|
[ -e ./config ] \
|
||||||
&& source ./config
|
&& source ./config
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
DFL_ID=${DFL_ID:=301}
|
DFL_ID=${DFL_ID:=301}
|
||||||
DFL_CTHOSTNAME=${NS_HOSTNAME:=${DFL_CTHOSTNAME:=syncthing}}
|
DFL_CTHOSTNAME=${NS_HOSTNAME:=${DFL_CTHOSTNAME:=syncthing}}
|
||||||
|
|
||||||
DFL_RAM=${RAM:=${DFL_RAM:=1024}}
|
DFL_RAM=${RAM:=${DFL_RAM:=1024}}
|
||||||
DFL_SWAP=${SWAP:=${DFL_SWAP:=$RAM}}
|
DFL_SWAP=${SWAP:=${DFL_SWAP:=$RAM}}
|
||||||
DFL_DRIVE=${DRIVE:=${DFL_DRIVE:=8}}
|
DFL_DRIVE=${DRIVE:=${DFL_DRIVE:=8}}
|
||||||
|
|
||||||
WAN_IP=-
|
WAN_IP=-
|
||||||
WAN_GATE=-
|
WAN_GATE=-
|
||||||
ADMIN_IP=-
|
ADMIN_IP=-
|
||||||
ADMIN_GATE=-
|
ADMIN_GATE=-
|
||||||
DFL_LAN_IP=-
|
DFL_LAN_IP=-
|
||||||
DFL_LAN_GATE=-
|
DFL_LAN_GATE=-
|
||||||
|
|
||||||
REBOOT=${REBOOT:=1}
|
REBOOT=${REBOOT:=1}
|
||||||
|
|
||||||
readVars
|
readVars
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
OPTS_STAGE_1="\
|
OPTS_STAGE_1="\
|
||||||
--hostname $CTHOSTNAME \
|
--hostname $CTHOSTNAME \
|
||||||
--memory $RAM \
|
--memory $RAM \
|
||||||
--swap $SWAP \
|
--swap $SWAP \
|
||||||
--net0 name=lan,bridge=vmbr0,firewall=1,ip=dhcp,type=veth \
|
--net0 name=lan,bridge=vmbr0,firewall=1,ip=dhcp,type=veth \
|
||||||
--net1 name=admin,bridge=vmbr1,firewall=1,ip=dhcp,type=veth \
|
--net1 name=admin,bridge=vmbr1,firewall=1,ip=dhcp,type=veth \
|
||||||
--storage local-lvm \
|
--storage local-lvm \
|
||||||
--rootfs local-lvm:$DRIVE \
|
--rootfs local-lvm:$DRIVE \
|
||||||
--unprivileged 1 \
|
--unprivileged 1 \
|
||||||
${PCT_EXTRA} \
|
${PCT_EXTRA} \
|
||||||
"
|
"
|
||||||
|
|
||||||
OPTS_STAGE_2="\
|
OPTS_STAGE_2="\
|
||||||
--startup order=90,up=10 \
|
--startup order=90,up=10 \
|
||||||
--onboot 1 \
|
--onboot 1 \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
echo "# Building config..."
|
echo "# Building config..."
|
||||||
buildAssets "$TEMPLATE_DIR" "$ASSETS_DIR"
|
buildAssets "$TEMPLATE_DIR" "$ASSETS_DIR"
|
||||||
|
|
||||||
echo "# Creating CT..."
|
echo "# Creating CT..."
|
||||||
pctCreateAlpine $ID "${OPTS_STAGE_1}" "$PASS"
|
pctCreateAlpine $ID "${OPTS_STAGE_1}" "$PASS"
|
||||||
|
|
||||||
echo "# Installing dependencies..."
|
echo "# Installing dependencies..."
|
||||||
@ lxc-attach $ID apk add bash syncthing
|
@ lxc-attach $ID apk add bash syncthing
|
||||||
|
|
||||||
echo "# Copying assets..."
|
echo "# Copying assets..."
|
||||||
@ pct-push-r $ID ./assets /
|
@ pct-push-r $ID ./assets /
|
||||||
|
|
||||||
echo "# Setup: dnsmasq..."
|
echo "# Setup: dnsmasq..."
|
||||||
@ lxc-attach $ID rc-update add syncthing
|
@ lxc-attach $ID rc-update add syncthing
|
||||||
@ lxc-attach $ID sed \
|
@ lxc-attach $ID sed \
|
||||||
-e 's/127\.0\.0\.1:8384/0.0.0.0:8384/g' \
|
-e 's/127\.0\.0\.1:8384/0.0.0.0:8384/g' \
|
||||||
-i /var/lib/syncthing/.config/syncthing/config.xml
|
-i /var/lib/syncthing/.config/syncthing/config.xml
|
||||||
@ lxc-attach $ID rc-service syncthing start
|
@ lxc-attach $ID rc-service syncthing start
|
||||||
|
|
||||||
echo "# Post config..."
|
echo "# Post config..."
|
||||||
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
pctSet $ID "${OPTS_STAGE_2}" $REBOOT
|
||||||
|
|
||||||
echo "# Done."
|
echo "# Done."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# vim:set ts=4 sw=4 :
|
# vim:set ts=4 sw=4 :
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user