From 892ae84fd97a6c54ab3adcd9150c4d25878f265d Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Mon, 19 Aug 2024 12:18:50 -0400 Subject: ly: create ly module --- modules/10-ly/install.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 modules/10-ly/install.sh (limited to 'modules/10-ly/install.sh') diff --git a/modules/10-ly/install.sh b/modules/10-ly/install.sh new file mode 100644 index 0000000..415c405 --- /dev/null +++ b/modules/10-ly/install.sh @@ -0,0 +1,24 @@ +_script="$(realpath ${BASH_SOURCE[0]})" +_scriptname="$(basename $_script)" +_scriptdir="$(dirname $_script)" +_modulename="$(basename $_scriptdir)" +DOT_MODULE_NAME="ly" + +function preinstall() { + PACKAGES+=("ly") +} + +function install() { + # backup old file if it exists and we haven't backed it up before + if ! [[ -f "$_scriptdir/.firstrun" ]]; then + if [[ -f "/etc/ly/config.ini" ]] && ! [[ -f "/etc/ly/config.ini.bak" ]]; then + log verbose "making backup of config.ini" + cp -r "/etc/ly/config.ini" "/etc/ly/config.ini.bak" + fi + touch "$_scriptdir/.firstrun" + fi + + log info "linking config.ini" + rm -rf "/etc/ly/config.ini" + ln -sf "$_scriptdir/config.ini" "/etc/ly/config.ini" +} -- cgit v1.2.3