Compare commits

...

3 Commits

2 changed files with 12 additions and 4 deletions

View File

@ -84,18 +84,25 @@ for fileIndex in ${!COPY[@]}; do
#DESTPATH="$ROOTFS""$DESTPATH"
PARENTPATHDEST="$(dirname "$PATHDEST")"
mkdir -p "$PARENTPATHDEST"
cp -r "$PATHSRC" "$PATHDEST"
cp --dereference -r "$PATHSRC" "$PATHDEST"
done
CMD="$1"
shift
if [[ "$CMD" != "" ]]; then
lxc-execute -n "$VMNAME" -- "$CMD" "$@"
[ $KEEP -eq 0 ] && lxc-destroy -n "$VMNAME"
lxc-start -n "$VMNAME"
lxc-attach -n "$VMNAME" -- "$CMD" "$@"
if [ $KEEP -eq 0 ]; then
lxc-stop --kill "$VMNAME"
lxc-destroy -n "$VMNAME"
fi
else
lxc-start -n "$VMNAME"
lxc-attach -n "$VMNAME" bash
[ $KEEP -eq 0 ] && lxc-stop --kill "$VMNAME" && lxc-destroy -n "$VMNAME"
if [ $KEEP -eq 0 ]; then
lxc-stop --kill "$VMNAME"
lxc-destroy -n "$VMNAME"
fi
fi

View File

@ -6,6 +6,7 @@ ExecStart=/usr/sbin/ramdisk.sh start
ExecStop=/usr/sbin/ramdisk.sh stop
Restart=on-failure
RestartPreventExitStatus=255
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target