~mil/sxmo-utils

sxmo-utils/setup_config_version.sh -rwxr-xr-x 375 bytes
2240b904Stacy Harper Add jami app 8 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors

case "$1" in
	*.json)
		# we ignore json files
		exit
esac

comment="#"
case "$(busybox head -n1 "$1")" in
	!*)
		comment="!"
		;;
	--*)
		comment="--"
		;;
esac

busybox md5sum "$1" | \
	busybox cut -d" " -f1 | \
	busybox xargs -I{} busybox sed -i "2i$comment configversion: {}" \
	"$1"