Compare commits
3 Commits
99be1f49af
...
6d81507a99
Author | SHA1 | Date | |
---|---|---|---|
6d81507a99 | |||
700fc8ce33 | |||
52cfb26a3a |
15
bin/mkvm.sh
15
bin/mkvm.sh
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user