mirror of
https://github.com/derfenix/photocatalog.git
synced 2026-03-11 11:52:57 +03:00
Initial commit
This commit is contained in:
24
init/install_service.sh
Executable file
24
init/install_service.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
INIT=${1:-systemd}
|
||||
|
||||
CONFIG_PATH="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||
SETTINGS_PATH="${CONFIG_PATH}/photocatalog"
|
||||
|
||||
SYSTEMD_UNIT_PATH="${CONFIG_PATH}/systemd/user/"
|
||||
|
||||
if "${INIT}" == "systemd"
|
||||
then
|
||||
cp ./init/systemd/photocatalog.service $SYSTEMD_UNIT_PATH/photocatalog.service
|
||||
if test ! -f "${SETTINGS_PATH}"
|
||||
then
|
||||
echo "TARGET=<specify target dir>\nMONITOR=<specify dir to monitor>\nMODE=hardlink" > "${SETTINGS_PATH}"
|
||||
${EDITOR} "${SETTINGS_PATH}"
|
||||
exit $?
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Unknown init"
|
||||
exit 2
|
||||
11
init/systemd/photocatalog.service
Normal file
11
init/systemd/photocatalog.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Organize photo files, received from Syncthing or other syncing tools
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
EnvironmentFile=/home/%u/.config/photocatalog
|
||||
ExecStart=photocatalog -mode $MODE -target $TARGET -monitor $MONITOR
|
||||
ExecStartPre=photocatalog -mode $MODE -target $TARGET ${MONITOR}
|
||||
Reference in New Issue
Block a user