Initial release
Original message: https://t.me/TelegramDesktopTalk/95796
This commit is contained in:
commit
b04d23dfcd
31
tg-setup
Normal file
31
tg-setup
Normal file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
permerr(){
|
||||
printf "This script has been executed as the root user.\n"
|
||||
printf "Please run it as a regular user instead.\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ $(id -u) == "0" ] && permerr
|
||||
|
||||
# Environment variables
|
||||
user_id=$(id -u)
|
||||
user_name=$(whoami)
|
||||
tmp="/tmp/tg-setup"
|
||||
data="/home/${user_name}/.local/share/TelegramDesktop"
|
||||
|
||||
# Establish the tmpfs for Telegram
|
||||
mkdir $tmp
|
||||
cp -rv $data/* $tmp
|
||||
sudo mount -t tmpfs -o size=256M,mode=1777 telegram $data
|
||||
cp -rv $tmp/* $data/
|
||||
telegram
|
||||
|
||||
read -p "Do you want to remove the cached application data? (y/n) " remove_app_data
|
||||
|
||||
f_remove_app_data(){
|
||||
sudo umount telegram
|
||||
rm -r $tmp
|
||||
}
|
||||
|
||||
[ "$remove_app_data" != "n" ] && f_remove_app_data
|
Loading…
x
Reference in New Issue
Block a user