code.fastix.org

Dateiansicht:

Datei:Projekte -> roger-router-restart -> roger-restart.sh
md5:83552f89b4e3e950008133fadcbf8a7f
sha1:ff318fe7a76989ac70d8cff180bcfc1d5080ad6f
Download-Link:Download
  1. #! /bin/bash
  2.  
  3. # Only 'yes' will enable the debugging to ~/.var/app/org.tabos.roger/data/lastlog
  4. debug='no';
  5. #debug='yes';
  6.  
  7. # @First kill old session:
  8. pid=$(ps ax | grep -P "roger( -d)*$" | grep -v "flatpak" | cut -d ' ' -f2);
  9. if [ -n "${pid}" ]; then
  10.         kill ${pid};
  11. fi
  12.  
  13. if [ 'yes' = $debug ]; then
  14.         # Remove the oldest Log
  15.         if [ -f ~/.var/app/org.tabos.roger/data/lastlog.old ]; then
  16.                 rm ~/.var/app/org.tabos.roger/data/lastlog.old
  17.         fi
  18.  
  19.         # Move the last log to .old
  20.         if [ -f ~/.var/app/org.tabos.roger/data/lastlog ]; then
  21.                 mv ~/.var/app/org.tabos.roger/data/lastlog ~/.var/app/org.tabos.roger/data/lastlog.old
  22.         fi
  23.         # Run!
  24.         flatpak run org.tabos.roger > ~/.var/app/org.tabos.roger/data/lastlog
  25. else
  26.         # Run!
  27.         flatpak run org.tabos.roger -d > ~/.var/app/org.tabos.roger/data/lastlog
  28. fi
  29.