set fusermount systemspecific

This commit is contained in:
Jakobus Schürz 2020-03-22 05:43:40 +01:00
parent 7cfcef713e
commit 42e6c9a1c3
2 changed files with 6 additions and 2 deletions

View file

@ -1,10 +1,15 @@
#!/bin/sh #!/bin/sh
FUSERMOUNT=$(which fusermount)
echo $FUSERMOUNT
. ./uninstall.sh . ./uninstall.sh
echo "Install workdirfs for all users" echo "Install workdirfs for all users"
sudo cp workdirfs.py /usr/local/bin/workdirfs.py 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
echo replace
sudo sed -i -e "s@%FUSERMOUNT%@${FUSERMOUNT}@" /etc/systemd/user/workdirfs.service
echo replaced
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
systemctl --user daemon-reload systemctl --user daemon-reload

View file

@ -4,5 +4,4 @@ Description=Daily working directory ~/Work
[Service] [Service]
Environment=MOUNTPOINT=Work Environment=MOUNTPOINT=Work
ExecStart=/usr/bin/python3 -u /usr/local/bin/workdirfs.py -m $MOUNTPOINT ExecStart=/usr/bin/python3 -u /usr/local/bin/workdirfs.py -m $MOUNTPOINT
ExecStop=-/usr/bin/fusermount -u ${MOUNTPOINT} ExecStop=%FUSERMOUNT% -u ${MOUNTPOINT}
ExecStop=-/bin/fusermount -u ${MOUNTPOINT}