From f039ce7b351b89a6bd1d195f5d99bef9a44a278f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 25 Oct 2020 09:00:51 +0100 Subject: [PATCH] add webircgateway --- .DS_Store | Bin 0 -> 8196 bytes conf/config.conf.example | 128 +++++++++++++++++++++++++++++++++++++++ conf/config.json.example | 2 +- conf/systemd.service | 14 +++++ scripts/backup | 6 ++ scripts/install | 48 +++++++++++---- scripts/remove | 20 ++++++ scripts/restore | 22 +++++++ 8 files changed, 228 insertions(+), 12 deletions(-) create mode 100644 .DS_Store create mode 100644 conf/config.conf.example create mode 100644 conf/systemd.service diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a041dd0994dd52e24a31063a1f2aa4f16a4b2270 GIT binary patch literal 8196 zcmeHMU2GIZ9G~A&=q@ah##1Sz3%2WyE zMdL@*7^C8YA3-B%qKP4j`h+Hc#`vHTNmRfGAAB$-zNnbsi~rf#D{w77nTWEJ%=~Bm zU%T_$-|XD%F~-nRFc&ixXN)OSh1ADUGeQw|QHPaSs2M{N6wk5)UVqkhvo!vFn0KUz z5Qq?n5Qq?n5Qq@C9uS~CTNLFQ`@XbBZG=FCzzvCjct0em3YiM!pp?O@gPPz7K(d0= zL7~1bIwX^!Ooeh#O0rOa3?(T;5gsuh!%3eE{ZgSElv0K>goh7=S4Mb3L2z}-pA6g? zQc^~3gg}JAa0JBJy@KVK%N*8w<@r6^Z(E*UU;iy)qbf#^sZ`Xls-{j*wY$@M+<~-j z_yw=U$oJ?o)0WAzM!wTB{XH4(thITOJDcAYjR z&Ti5P|4QZ&NClQBusHMnt57vGE+u%DEdD2;DucxKimmeNPwZHUJ?Ad7XPh=ZzJ9~{ zJGJ&ME9W|C>jB=QPxOc%8)(>(=SAX0XU???eU8_oSLF;lSFnjhYiwIMlWwAy%e%JS z;d+*DxlVVN&-eMIL|2)*wtH^gZw-?5=z789TR7#iioA_7QmRSfYMc8-8gCoVdnBt< zDSFOS)VC*0ojGUT!bOeEt6R@b)T<_GleHYbIpz?RsDTsr%89R$u&i!Dg9^1Z&8#T zLf@L_)JnBh6Tel}4JG3d3Nl5lR;TKon%PUsMTRcc8Wi1Bx7tRQ+fubmTdwFE)y|@v zo>Z>XRw-4eRl9O-UmxAKC)KHVi=uy~>=M^*H#~oHKX)$Q)jCD#7M3-p$xWqNqQqEr zYJuzqQ&x4chtFd3*>d`|kYT;FTn@6Q*kN{@onRla&)L`PJo|zD%r3G&*d_KS7*vdf zhVht!1d^DGYSg0{E3guGpaXXyjSRYxMGhRj*b5&83}7D~#AA3IPvA*BhnMjRUd3y8 z3-94LKEQ|g6kp;ioWXfqz>oL^zv4G}pRv-y-&C4{l(`n-Vk^;+ z?<-#*rG=wc3gRheh4-AfiG(f~Cx`QE5}FQL6l!3-t%j_z(6*?aY@>+(($=_COX#DC z>N2u zj^W*axF_&2PT~|!;}d*=Z*ZZEvh8J*{eC!Q%XX}*14bB)lDfD!|F6CF_x}+hBUOYz zguwp=0aUc5+gfNgrR}kNV&bfwq/dev/null +then + ynh_script_progression --message="Removing $app service integration..." --weight=1 + yunohost service remove $app +fi + +#================================================= +# STOP AND REMOVE SERVICE +#================================================= +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 + +# Remove the dedicated systemd config +ynh_remove_systemd_config + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index f36582a..f5481c0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,6 +70,28 @@ ynh_script_progression --message="Restoring user rights..." --weight=1 # Restore permissions on app files chown -R $app:$app $final_path +#================================================= +# RESTORE SYSTEMD +#================================================= +ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +systemctl enable $app.service + +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + +yunohost service add $app --description "A short description of the app" --log "/var/log/$app/$app.log" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" + #================================================= # RELOAD NGINX #=================================================