summarylogtreecommitdiffstats
path: root/conduwuit.install
blob: 99e97456179b2a56da17e9b014aaa7f666653897 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function post_upgrade() {
	mkdir -p /var/lib/private/conduwuit
	if [ -f /var/lib/private/conduit ] || [ -d /var/lib/private/conduit ]; then
		echo "[Warning] State directory has moved, patching..."
		cp -a /var/lib/private/conduit/* /var/lib/private/conduwuit
		echo "Manual removal of old data under /var/lib/conduit/ is required"
	fi
	if [ -f /etc/conduwuit.toml ]; then
		install -Dm644 /etc/conduwuit.toml "/etc/conduwuit.toml.old"
		echo "[Warning] The configuration file has changed!"
		echo "Configure conduwuit @ /etc/conduwuit/conduwuit.toml, attempting to automatically migrate..."
		sleep 5s
		mv /etc/conduwuit.toml "/etc/conduwuit/conduwuit.toml"
	fi
	if [ ! -d /var/lib/private/matrix-conduit ]; then
		mkdir /var/lib/private/matrix-conduit
	fi
	if [ ! -d /var/lib/matrix-conduit ]; then
		mkdir /var/lib/matrix-conduit
	fi
}