summarylogtreecommitdiffstats
path: root/g910-gkeys-git.install
diff options
context:
space:
mode:
authorJérôme Launay2023-09-22 14:02:04 +0200
committerJérôme Launay2023-09-22 14:02:04 +0200
commit0aba0a626fc1793696b13ddd523758d823f19b22 (patch)
tree3a4af956f6c7ca21af9210717a4d740b00e41168 /g910-gkeys-git.install
parentbc80cd8a5c87dd96e19ee0a9f487068fbee74ccb (diff)
downloadaur-0aba0a626fc1793696b13ddd523758d823f19b22.tar.gz
change post install
Diffstat (limited to 'g910-gkeys-git.install')
-rwxr-xr-xg910-gkeys-git.install67
1 files changed, 6 insertions, 61 deletions
diff --git a/g910-gkeys-git.install b/g910-gkeys-git.install
index c3ba2de57748..2ab4bce78cf3 100755
--- a/g910-gkeys-git.install
+++ b/g910-gkeys-git.install
@@ -1,68 +1,13 @@
post_install() {
- # make config dir
- if [[ ! -d "$HOME"/.config/g910-gkeys ]]; then
- mkdir "$HOME"/.config/g910-gkeys
- fi
-
- # check for existing config file
- if [[ ! -f "$HOME"/.config/g910-gkeys/config.json ]]; then
- # if not copy default config to config dir
- cp ./etc/config.json "$HOME"/.config/g910-gkeys/config.json
- fi
-
- # reload daemon
- systemctl --user daemon-reload
-
- # enable and start service if necessary
- systemctl --user enable --now g910-gkeys.service
-
- echo ""
- echo "#########################################################"
- echo ""
- echo "Service ${_appname} was enabled and started by default:"
- echo ""
- echo "Config is in ${HOME}/.config/g910-gkeys/config.json"
- echo "Log file is stored in ${HOME}/g910-gkeys.log"
- echo ""
- echo "#########################################################"
- echo ""
-}
-
-
-post_upgrade() {
- # make config dir
- if [[ ! -d "$HOME"/.config/g910-gkeys ]]; then
- mkdir "$HOME"/.config/g910-gkeys
- fi
-
- # check for existing config file
- if [[ ! -f "$HOME"/.config/g910-gkeys/config.json ]]; then
- if [[ -f /etc/g910-gkeys/config.json ]]; then
- # if old config exist move it to new location (will need root privileges)
- sudo mv /etc/g910-gkeys/config.json "$HOME"/.config/g910-gkeys/config.json
- sudo chown "$USER":"$USER" "$HOME"/.config/g910-gkeys/config.json
- else
- # if not copy default config to config dir
- cp ./etc/config.json "$HOME"/.config/g910-gkeys/config.json
- fi
- fi
-
- # reload daemon
- systemctl --user daemon-reload
-
- # enable and start service if necessary
- systemctl --user enable --now g910-gkeys.service
-
echo ""
- echo "#########################################################"
+ echo "Since the service is now running as a user service you need to move your configuration to your user home:"
+ echo "sudo cp /etc/g910-gkeys/config.json "$HOME"/.config/g910-gkeys/config.json"
+ echo "sudo chown "$USER":users "$HOME"/.config/g910-gkeys/config.json"
echo ""
- echo "Service ${_appname} was enabled and started by default:"
+ echo "Then you can enable and run the user service"
+ echo "systemctl --user enable --now g910-gkeys.service"
+ echo "systemctl --user start g910-gkeys.service"
echo ""
- echo "Config is in ${HOME}/.config/g910-gkeys/config.json"
- echo "Log file is stored in ${HOME}/g910-gkeys.log"
- echo ""
- echo "#########################################################"
- echo ""
}
pre_remove() {