File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,25 +29,22 @@ function update_script() {
2929 msg_error " No ${APP} Installation Found!"
3030 exit
3131 fi
32+ if [[ ! -d /opt/glance_data ]]; then
33+ msg_info " Creating config directory"
34+ mkdir -p /opt/glance_data/
35+ cp /opt/glance/* .yml /opt/glance_data/
36+ sed -i ' s|/opt/glance/glance\.yml|/opt/glance_data/glance.yml|' /etc/systemd/system/glance.service
37+ systemctl daemon-reload
38+ msg_ok " Created config directory"
39+ fi
40+
3241 if check_for_gh_release " glance" " glanceapp/glance" ; then
3342 msg_info " Stopping Service"
3443 systemctl stop glance
3544 msg_ok " Stopped Service"
3645
37- if [[ -f /opt/glance/glance.yml ]]; then
38- msg_info " Backing up glance.yml"
39- cp /opt/glance/glance.yml /tmp/glance.yml.bak
40- msg_ok " Backed up glance.yml"
41- fi
42-
4346 CLEAN_INSTALL=1 fetch_and_deploy_gh_release " glance" " glanceapp/glance" " prebuild" " latest" " /opt/glance" " glance-linux-amd64.tar.gz"
4447
45- if [[ -f /tmp/glance.yml.bak ]]; then
46- msg_info " Restoring glance.yml"
47- mv /tmp/glance.yml.bak /opt/glance/glance.yml
48- msg_ok " Restored glance.yml"
49- fi
50-
5148 msg_info " Starting Service"
5249 systemctl start glance
5350 msg_ok " Started Service"
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ update_os
1616fetch_and_deploy_gh_release " glance" " glanceapp/glance" " prebuild" " latest" " /opt/glance" " glance-linux-amd64.tar.gz"
1717
1818msg_info " Configuring Glance"
19- cat << EOF >/opt/glance/glance.yml
19+ mkdir -p /opt/glance_data
20+ cat << EOF >/opt/glance_data/glance.yml
2021pages:
2122 - name: Startpage
2223 width: slim
3940msg_ok " Configured Glance"
4041
4142msg_info " Creating Service"
42- service_path= " /etc/systemd/system/glance.service"
43- echo " [Unit]
43+ cat << EOF > /etc/systemd/system/glance.service
44+ [Unit]
4445Description=Glance Daemon
4546After=network.target
4647
4748[Service]
4849Type=simple
4950WorkingDirectory=/opt/glance
50- ExecStart=/opt/glance/glance --config /opt/glance /glance.yml
51+ ExecStart=/opt/glance/glance --config /opt/glance_data /glance.yml
5152TimeoutStopSec=20
5253KillMode=process
5354Restart=on-failure
5455
5556[Install]
56- WantedBy=multi-user.target" > $service_path
57-
57+ WantedBy=multi-user.target
58+ EOF
5859systemctl enable -q --now glance
5960msg_ok " Created Service"
6061
You can’t perform that action at this time.
0 commit comments