summaryrefslogtreecommitdiff
path: root/modules/10-ly/install.sh
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2024-08-19 12:18:50 -0400
committerGalen Guyer <galen@galenguyer.com>2024-08-19 12:18:50 -0400
commit892ae84fd97a6c54ab3adcd9150c4d25878f265d (patch)
tree281ac5abe7129c53c37688975eea6d115e6cf22c /modules/10-ly/install.sh
parent107d0858a938ecb06f1f86d59f21fb31dfbae43f (diff)
ly: create ly moduleHEADmain
Diffstat (limited to 'modules/10-ly/install.sh')
-rw-r--r--modules/10-ly/install.sh24
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"
+}