replacing flock with simple if and touch

This commit is contained in:
Siina Mashek 2024-04-27 18:02:44 +03:00
parent fc5c034716
commit f1b9783547
3 changed files with 9 additions and 20 deletions

View file

@ -1,4 +0,0 @@
#!/bin/sh
export HOME=$HOME/games
/usr/bin/steam

View file

@ -1,4 +0,0 @@
#!/bin/sh
HOME=$HOME/.cache/vscode-oss /usr/bin/vscodium

View file

@ -1,22 +1,19 @@
#!/bin/sh #!/bin/sh
( if [ -f /tmp/nc-sync.lock ]; then
if flock -n 9 notify-send "Lock found, exiting"
then exit 1
echo 'Lock present, exiting' else
exit; touch /tmp/nc-sync.lock
fi
# Needed for cronjob # Needed for cronjob
source /home/siina/.config/private.env source /home/siina/.config/private.env
NC_DIR="/home/siina/Nextcloud" NC_DIR="/home/siina/Nextcloud"
NC_URL="https://cloud.criminallycute.fi" NC_URL="https://cloud.criminallycute.fi"
echo "Nextcloud Sync Syncing ..." notify-send "Nextcloud Sync Syncing ..."
nextcloudcmd -u $NC_USER -p $NC_PASS $NC_DIR $NC_URL nextcloudcmd -u $NC_USER -p $NC_PASS $NC_DIR $NC_URL
echo "Nextcloud Sync Done syncing" notify-send "Nextcloud Sync Done syncing"
rm /tmp/nc-sync.lock
) 9>'/tmp/nc-sync.lock' fi
rm -f '/tmp/nc-sync.lock'