diff --git a/.vscode/settings.json b/.vscode/settings.json index be834d9..2eb7a5b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,39 @@ { "files.associations": { "*.func": "shellscript" - } -} \ No newline at end of file + }, + "files.eol": "\n", + "files.encoding": "utf8", + "files.trimTrailingWhitespace": true, + "files.insertFinalNewline": true, + "files.autoSave": "afterDelay", + "files.autoGuessEncoding": false, + + "editor.detectIndentation": false, + "editor.tabSize": 4, + "editor.insertSpaces": true, + "editor.wordWrap": "off", + "editor.renderWhitespace": "boundary", + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.minimap.enabled": false, + + "terminal.integrated.shell.linux": "/bin/bash", + "terminal.integrated.scrollback": 10000, + + "[shellscript]": { + "editor.defaultFormatter": "foxundermoon.shell-format", + "editor.tabSize": 4, + "editor.insertSpaces": true + }, + + "workbench.colorTheme": "Default Dark+", + "workbench.iconTheme": "vscode-icons", + + "git.autofetch": true, + "git.confirmSync": false, + "git.enableSmartCommit": true, + + "extensions.ignoreRecommendations": false, + "security.workspace.trust.untrustedFiles": "open" +} diff --git a/ct/healthchecks.sh b/ct/healthchecks.sh index 39fe730..124b0ba 100644 --- a/ct/healthchecks.sh +++ b/ct/healthchecks.sh @@ -37,4 +37,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8000${CL}" diff --git a/ct/koel.sh b/ct/koel.sh index 1b14a47..394083a 100644 --- a/ct/koel.sh +++ b/ct/koel.sh @@ -24,45 +24,45 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/koel ]]; then - msg_error "No ${APP} Installation Found!" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/koel ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -s https://api.github.com/repos/koel/koel/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + msg_info "Stopping ${APP} Service" + systemctl stop nginx + msg_ok "Stopped ${APP} Service" + + msg_info "Updating ${APP} to v${RELEASE}" + cd /opt + wget -q https://github.com/koel/koel/releases/download/${RELEASE}/koel-${RELEASE}.zip + unzip -q koel-${RELEASE}.zip + cd /opt/koel + composer update --no-interaction >/dev/null 2>&1 + composer install --no-interaction >/dev/null 2>&1 + php artisan migrate --force >/dev/null 2>&1 + php artisan cache:clear >/dev/null 2>&1 + php artisan config:clear >/dev/null 2>&1 + php artisan view:clear >/dev/null 2>&1 + php artisan koel:init --no-interaction >/dev/null 2>&1 + msg_ok "Updated ${APP} to v${RELEASE}" + + msg_info "Starting ${APP} Service" + systemctl start nginx + msg_ok "Started ${APP} Service" + + msg_info "Cleaning up" + rm -rf /opt/koel-${RELEASE}.zip + msg_ok "Cleaned" + msg_ok "Updated Successfully!\n" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + fi exit - fi - RELEASE=$(curl -s https://api.github.com/repos/koel/koel/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then - msg_info "Stopping ${APP} Service" - systemctl stop nginx - msg_ok "Stopped ${APP} Service" - - msg_info "Updating ${APP} to v${RELEASE}" - cd /opt - wget -q https://github.com/koel/koel/releases/download/${RELEASE}/koel-${RELEASE}.zip - unzip -q koel-${RELEASE}.zip - cd /opt/koel - composer update --no-interaction >/dev/null 2>&1 - composer install --no-interaction >/dev/null 2>&1 - php artisan migrate --force >/dev/null 2>&1 - php artisan cache:clear >/dev/null 2>&1 - php artisan config:clear >/dev/null 2>&1 - php artisan view:clear >/dev/null 2>&1 - php artisan koel:init --no-interaction >/dev/null 2>&1 - msg_ok "Updated ${APP} to v${RELEASE}" - - msg_info "Starting ${APP} Service" - systemctl start nginx - msg_ok "Started ${APP} Service" - - msg_info "Cleaning up" - rm -rf /opt/koel-${RELEASE}.zip - msg_ok "Cleaned" - msg_ok "Updated Successfully!\n" - else - msg_ok "No update required. ${APP} is already at v${RELEASE}" - fi - exit } start