diff options
Diffstat (limited to 'modules/10-ly/install.sh')
-rw-r--r-- | modules/10-ly/install.sh | 24 |
1 files changed, 24 insertions, 0 deletions
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" +} |