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"
|
#DESTPATH="$ROOTFS""$DESTPATH"
|
||||||
PARENTPATHDEST="$(dirname "$PATHDEST")"
|
PARENTPATHDEST="$(dirname "$PATHDEST")"
|
||||||
mkdir -p "$PARENTPATHDEST"
|
mkdir -p "$PARENTPATHDEST"
|
||||||
cp -r "$PATHSRC" "$PATHDEST"
|
cp --dereference -r "$PATHSRC" "$PATHDEST"
|
||||||
done
|
done
|
||||||
|
|
||||||
CMD="$1"
|
CMD="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if [[ "$CMD" != "" ]]; then
|
if [[ "$CMD" != "" ]]; then
|
||||||
lxc-execute -n "$VMNAME" -- "$CMD" "$@"
|
lxc-start -n "$VMNAME"
|
||||||
[ $KEEP -eq 0 ] && lxc-destroy -n "$VMNAME"
|
lxc-attach -n "$VMNAME" -- "$CMD" "$@"
|
||||||
|
if [ $KEEP -eq 0 ]; then
|
||||||
|
lxc-stop --kill "$VMNAME"
|
||||||
|
lxc-destroy -n "$VMNAME"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
lxc-start -n "$VMNAME"
|
lxc-start -n "$VMNAME"
|
||||||
lxc-attach -n "$VMNAME" bash
|
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
|
fi
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ ExecStart=/usr/sbin/ramdisk.sh start
|
||||||
ExecStop=/usr/sbin/ramdisk.sh stop
|
ExecStop=/usr/sbin/ramdisk.sh stop
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartPreventExitStatus=255
|
RestartPreventExitStatus=255
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in New Issue
Block a user