0
0
mirror of https://github.com/ventoy/Ventoy.git synced 2024-11-22 09:46:16 +00:00
Ventoy/VBLADE/vblade-master/contrib/persistence/vblade.init.generate
2020-04-05 00:08:01 +08:00

25 lines
647 B
Bash

#!/bin/sh
set -e
TEMPDIR="$(mktemp --directory --tmpdir "vblade.init.generate.$$.XXXXX")"
trap "cd / ; rm -rf \"$TEMPDIR\"" EXIT
run () {
local OUTPUT="$1"
echo "I: Processing $OUTPUT"
TEMP="$TEMPDIR/$OUTPUT"
shift
tpage "$@" vblade.init.in>"$TEMP"
sh -n "$TEMP"
if [ -f "$OUTPUT" ] && cmp -s "$TEMP" "$OUTPUT" ; then
echo "I: $OUTPUT is fresh"
else
cp "$TEMP" "$OUTPUT"
fi
}
# run 'vblade.init.debian' --define lsb=1 --define control=ssd
run 'vblade.init.lsb-daemon' --define lsb=1 --define control=daemon
run 'vblade.init.daemon' --define lsb= --define control=daemon