change configs

This commit is contained in:
Jakobus Schürz 2020-02-12 17:30:08 +01:00
parent 813871beee
commit b18e8042b5
5 changed files with 14 additions and 5 deletions

View file

@ -4,5 +4,7 @@ sudo cp workdirfs.py /usr/local/bin/workdirfs.py
cp workdirfs.service ~/.config/systemd/user/workdirfs.service cp workdirfs.service ~/.config/systemd/user/workdirfs.service
sudo mkdir -pv ~/.config/systemd/user/default.target.wants/ sudo mkdir -pv ~/.config/systemd/user/default.target.wants/
sudo ln -sf ../workdirfs.service ~/.config/systemd/user/default.target.wants/workdirfs.service sudo ln -sf ../workdirfs.service ~/.config/systemd/user/default.target.wants/workdirfs.service
cp workdirfs.config ~/.config/workdirfs.conf
sudo cp workdirfs.config /etc/workdirfs.conf
systemctl --user daemon-reload systemctl --user daemon-reload
systemctl --user restart workdirfs.service systemctl --user restart workdirfs.service

View file

@ -4,5 +4,6 @@ sudo cp workdirfs.py /usr/local/bin/workdirfs.py
sudo cp workdirfs.service /etc/systemd/user/workdirfs.service sudo cp workdirfs.service /etc/systemd/user/workdirfs.service
sudo mkdir -pv /etc/systemd/user/default.target.wants/ sudo mkdir -pv /etc/systemd/user/default.target.wants/
sudo ln -sf ../workdirfs.service /etc/systemd/user/default.target.wants/workdirfs.service sudo ln -sf ../workdirfs.service /etc/systemd/user/default.target.wants/workdirfs.service
sudo cp workdirfs.config /etc/workdirfs.conf
systemctl --user daemon-reload systemctl --user daemon-reload
systemctl --user restart workdirfs.service systemctl --user restart workdirfs.service

View file

@ -4,6 +4,6 @@ echo "Remove workdirfs"
echo "stop workdirfs.service" echo "stop workdirfs.service"
systemctl --user stop workdirfs.service systemctl --user stop workdirfs.service
echo "remove binaries and units from system" echo "remove binaries and units from system"
sudo rm -rf /usr/local/bin/workdirfs.py /etc/systemd/user/workdirfs.service /etc/systemd/user/default.target.wants/workdirfs sudo rm -rf /usr/local/bin/workdirfs.py /etc/workdirfs.conf /etc/systemd/user/workdirfs.service /etc/systemd/user/default.target.wants/workdirfs
echo "remove systemd-units for this user $USER" echo "remove systemd-units for this user $USER"
rm -rf ~/.config/systemd/user/workdirfs.service ~/.config/systemd/user/default.target.wants/workdirfs.service rm -rf ~/.config/workdirfs.conf ~/.config/systemd/user/workdirfs.service ~/.config/systemd/user/default.target.wants/workdirfs.service

5
workdirfs.conf Normal file
View file

@ -0,0 +1,5 @@
ARCHIVE=${HOME}/archive
MOUNTPOINT=${HOME}/Work
TIMEOFFSET=2
MONTHLYDIR=False
YEARLYDIR=False

View file

@ -2,6 +2,7 @@
Description=Daily working directory ~/Work Description=Daily working directory ~/Work
[Service] [Service]
Environment=WORKDIRFS_OPTIONS="-a %h/archive -m %h/Work -t 3 -M False -y False" EnvironmentFile=/etc/workdirfs.conf
ExecStart=/usr/bin/python3 -u /usr/local/bin/workdirfs.py ${WORKDIRFS_OPTIONS} EnvironmentFile=-%h/.config/workdirfs.conf
ExecStop=/usr/bin/fusermount -u ${DST} ExecStart=/usr/bin/python3 -u /usr/local/bin/workdirfs.py --archive ${ARCHIVE} --mountpoint ${MOUNTPOINT} --timeoffset ${TIMEOFFSET} --yearlydir ${YEARLYDIR} --monthlydir ${MONTHLYDIR}
ExecStop=/usr/bin/fusermount -u ${MOUNTPOINT}