iopsys-feed/swmodd/files/etc/uci-defaults/01-fix-bundle-path
2022-08-19 19:17:46 +05:30

21 lines
471 B
Bash

#!/bin/sh
. /lib/functions.sh
# if bundle_root not define in swmodd, update it with lxc path
lxc=""
bundle=""
if [ -f "/etc/lxc/lxc.conf" ]; then
lxc=$(cat /etc/lxc/lxc.conf |grep "lxc.lxcpath"| cut -d "=" -f 2)
fi
config_load swmodd
config_get bundle globals bundle_root ""
if [ -z "${bundle}" ] && [ -n "${lxc}" ]; then
uci_set swmodd globals bundle_root ${lxc}
uci_commit
elif [ -z "${bundle}" ]; then
uci_set swmodd globals bundle_root "/tmp/"
uci_commit
fi