Prevent qtox from being opened more than once

This commit is contained in:
Bob Mottram 2016-08-24 20:46:43 +01:00
parent 9f6d10682e
commit a2e1a98b0b
No known key found for this signature in database
GPG Key ID: 0452CC7CEA982E38
1 changed files with 10 additions and 2 deletions

View File

@ -743,12 +743,20 @@ if [ \$no_of_users -gt 0 ]; then
chmod +x /home/$MY_USERNAME/Desktop/Users.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/Users.desktop
if [ ! -f /home/$MY_USERNAME/Desktop/tox.desktop ]; then
if [ ! -f /home/$MY_USERNAME/runtox ]; then
echo 'qtox_running=\$(ps aux | grep qtox | grep data)' >> /home/$MY_USERNAME/runtox
echo 'if [ \${#qtox_running} -eq 0 ]; then' >> /home/$MY_USERNAME/runtox
echo ' bash -c "qtox -p data"' >> /home/$MY_USERNAME/runtox
echo 'fi' >> /home/$MY_USERNAME/runtox
echo 'exit 0' >> /home/$MY_USERNAME/runtox
chmod +x /home/$MY_USERNAME/runtox
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/runtox
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/tox.desktop
echo 'Name=Tox Chat' >> /home/$MY_USERNAME/Desktop/tox.desktop
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/tox.desktop
echo 'Comment=Chat, VoIP and Video' >> /home/$MY_USERNAME/Desktop/tox.desktop
echo "Exec=bash -c 'qtox -p data'" >> /home/$MY_USERNAME/Desktop/tox.desktop
echo 'Exec=bash /usr/$MY_USERNAME/runtox' >> /home/$MY_USERNAME/Desktop/tox.desktop
echo 'Icon=/usr/share/icons/hicolor/32x32/apps/qtox.png' >> /home/$MY_USERNAME/Desktop/tox.desktop
echo 'StartupNotify=true' >> /home/$MY_USERNAME/Desktop/tox.desktop
chmod +x /home/$MY_USERNAME/Desktop/tox.desktop