SHARE
TWEET

Untitled

a guest Apr 26th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/sh
  2. set -e
  3. set -x
  4.  
  5. ulimit -v 4000000
  6. ulimit -c 2000000
  7.  
  8. export BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/telegram-desktop_telegramdesktop.desktop
  9.  
  10. telegram="/snap/bin/telegram-desktop"
  11.  
  12. tgid="$(basename $0 .sh)"
  13.  
  14. if [ -n "$tgid" ]; then
  15.   workdir="$HOME/snap/telegram-desktop/current/.local/share/$tgid"
  16.   if ( ps -ax | grep -v grep | grep 'Telegram' | grep -qF "$workdir" ) ; then
  17.     echo "telegram instance $tgid seems already started"
  18.     exit
  19.   fi
  20.   test -d "$workdir" || mkdir -p "$workdir"
  21.   wd="-workdir $workdir"
  22. else
  23.   if ( ps -ax | grep -v grep | grep -qF Telegram ) ; then
  24.     echo "telegram instance seems already started"
  25.     exit
  26.   fi
  27. fi
  28.  
  29. echo "start telegram instance $tgid ..."
  30. if [ -z "$*" ]; then
  31.   $telegram -noupdate -many $wd &>/dev/null &
  32. else
  33.   $telegram -noupdate -many $wd $*
  34. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top