-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateBetterbird
executable file
·256 lines (246 loc) · 10.8 KB
/
updateBetterbird
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
#!/usr/bin/env bash
set -E +x # Halt on errors, no trace
# updateBetterbird - Update or install betterbird email client
# Usage: updateBetterbird
# Required: procps(pgrep) coreutils(mktemp cd rm cat mv ln cp) tar wget sudo
# xdg-utils(xdg-desktop-menu)
# lang: en-US/de/fr/it/es-AR/pt-BR/ja
lang=en-US
# version: release/previous/latest/future
version=release
# Installation path
installpath=/opt
# Path to .desktop file
desktopfile=/usr/local/share/applications/betterbird.desktop
# Get current version
current=
[[ -f $installpath/betterbird/application.ini ]] && # Installed
current=$(grep '^Version=' "$installpath/betterbird/application.ini") &&
echo "Current: ${current##*=}"
# Downloading the release, getting the version and check if installed already
tmpdir=$(mktemp -d) tmp=$tmpdir/bb.tar.bzip2
trap "rm -rf $tmpdir" EXIT # ERR
echo "Downloading release version..."
wget -qO $tmp "https://www.betterbird.eu/downloads/get.php?os=linux&lang=$lang&version=$version"
_=$(sha256sum $tmp) hash=${_%% *}
tar xf $tmp -C $tmpdir
_=$(grep '^Version=' $tmpdir/betterbird/application.ini) v=${_##*=} s=${v:0:3}
echo "Downloaded version $v"
[[ -d $installpath/betterbird-$v ]] &&
echo "Aborting: Version $v already installed in '$installpath'" &&
exit 2
# Checksum
shafile=$tmpdir/sha256.txt
wget -qO $shafile "www.betterbird.eu/downloads/sha256-$s.txt"
! grep -q $hash $shafile && # no hash match
echo "Aborting: Hash '$hash' not in '$shafile'" &&
exit 3
# Abort if still running
(($(pgrep -c betterbird-bin))) &&
echo "Aborting: Betterbird is running, please close it first" &&
exit 1
# Install
sudo mkdir -p "$installpath"
cd "$installpath"
[[ -L betterbird ]] && # Link to directory
sudo rm betterbird
[[ -d betterbird ]] && # Directory
old=$(sudo mktemp betterbird_XXXXXXXX) &&
sudo mv betterbird $old
sudo mv $tmpdir/betterbird betterbird-$v
sudo ln -s betterbird-$v betterbird
# Make .desktop file and update it
cat <<-EOF >$tmpdir/desktop
[Desktop Entry]
Version=1.0
X-Desktop-File-Install-Version=$v
Encoding=UTF-8
Type=Application
Terminal=false
Name=Betterbird
Categories=Network;Email;
Exec=$installpath/betterbird/betterbird %u
Icon=$installpath/betterbird/chrome/icons/default/default256.png
MimeType=message/rfc822;x-scheme-handler/mailto;application/x-xpinstall;application/x-extension-ics;text/calendar;text/vcard;text/x-vcard;x-scheme-handler/webcal;x-scheme-handler/webcals;x-scheme-handler/mid;
StartupNotify=true
StartupWMClass=betterbird
Actions=ComposeMessage;OpenAddressBook
Name[ast]=Veceru de corréu Betterbird
Name[ca]=Client de correu Betterbird
Name[cs]=Poštovní klient Betterbird
Name[da]=Betterbird - e-post/nyhedsgruppe
Name[de]=Betterbird-E-Mail und -Nachrichten
Name[el]=Ηλεκτρονική αλληλογραφία Betterbird
Name[es_ES]=Cliente de correo Betterbird
Name[es_AR]=Cliente de correo Betterbird
Name[fi]=Betterbird-sähköposti
Name[fr]=Messagerie Betterbird
Name[gl]=Cliente de correo Betterbird
Name[he]=Betterbird דוא״ל/חדשות
Name[hr]=Betterbird e-pošta/novosti
Name[hu]=Betterbird levelezőkliens
Name[it]=Email Betterbird
Name[ja]=Betterbird 電子メールクライアント
Name[ko]=Betterbird
Name[nl]=Betterbird e-mail/nieuws
Name[pl]=Klient poczty Betterbird
Name[pt_BR]=Cliente de E-mail Betterbird
Name[ru]=Почтовый клиент Betterbird
Name[sk]=Betterbird - poštový klient
Name[sv]=E-postklienten Betterbird
Name[th]=โปรแกรมอีเมล Betterbird
Name[uk]=Поштова програма Betterbird
Name[vi]=Trình điện thư Betterbird
Name[zh_CN]=Betterbird 邮件/新闻
Name[zh_TW]=Betterbird 郵件
Comment=Send and receive mail with Betterbird
Comment[ast]=Lleer y escribir corréu electrónicu
Comment[ca]=Llegiu i escriviu correu
Comment[cs]=Čtení a psaní pošty
Comment[da]=Skriv/læs e-post/nyhedsgruppe med Betterbird
Comment[de]=E-Mails und Nachrichten mit Betterbird lesen und schreiben
Comment[el]=Διαβάστε και γράψτε γράμματα με το Betterbird
Comment[es_ES]=Lea y escriba correos y noticias con Betterbird
Comment[es_AR]=Lea y escriba correos y noticias con Betterbird
Comment[fi]=Lue ja kirjoita sähköposteja
Comment[fr]=Lire et écrire des courriels
Comment[gl]=Lea e escriba correo electrónico
Comment[he]=קריאה/כתיבה של דוא״ל/חדשות באמצעות Betterbird
Comment[hr]=Čitajte/šaljite e-poštu s Betterbird
Comment[hu]=Levelek írása és olvasása a Betterbirddel
Comment[it]=Per leggere e scrivere email
Comment[ja]=メールの読み書き
Comment[ko]=Betterbird 메일/뉴스 읽기 및 쓰기 클라이언트
Comment[nl]=E-mail/nieuws lezen en schrijven met Betterbird
Comment[pl]=Czytanie i wysyłanie e-maili
Comment[pt_BR]=Leia e escreva suas mensagens
Comment[ru]=Читайте и пишите письма
Comment[sk]=Čítajte a píšte poštu pomocou programu Betterbird
Comment[sv]=Läs och skriv e-post
Comment[th]=อ่านและแต่งอีเมล์
Comment[uk]=Читання та написання листів
Comment[vi]=Đọc và soạn thư điện tử
Comment[zh_CN]=阅读邮件或新闻
Comment[zh_TW]=以 Betterbird 讀寫郵件或新聞
GenericName=Mail Client
GenericName[ast]=Client de correu
GenericName[ca]=Client de correu
GenericName[cs]=Poštovní klient
GenericName[da]=E-postklient
GenericName[de]=E-Mail-Anwendung
GenericName[el]=Λογισμικό αλληλογραφίας
GenericName[es_ES]=Cliente de correo
GenericName[es_AR]=Cliente de correo
GenericName[fi]=Sähköpostiohjelma
GenericName[fr]=Client de messagerie
GenericName[gl]=Cliente de correo electrónico
GenericName[he]=לקוח דוא״ל
GenericName[hr]=Klijent e-pošte
GenericName[hu]=Levelezőkliens
GenericName[it]=Client email
GenericName[ja]=電子メールクライアント
GenericName[ko]=메일 클라이언트
GenericName[nl]=E-mailprogramma
GenericName[pl]=Klient poczty
GenericName[pt_BR]=Cliente de E-mail
GenericName[ru]=Почтовый клиент
GenericName[sk]=Poštový klient
GenericName[sv]=E-postklienten
GenericName[th]=โปรแกรมอีเมล
GenericName[uk]=Поштова програма
GenericName[vi]=Phần mềm khách quản lý thư điện tử
GenericName[zh_CN]=邮件新闻客户端
GenericName[zh_TW]=郵件用戶端
Keywords=Email;E-mail;Newsgroup;Feed;RSS
Keywords[ast]=Corréu;Corréu-e;Noticies;Discusiones;Mensaxes;Canales;RSS
Keywords[ca]=Correu;Email;E-mail;Mailing;Llistes;Notícies;RSS
Keywords[cs]=Email;E-mail;Pošta;Elektronická pošta;Diskusní skupiny;Čtečka;RSS
Keywords[da]=Email;E-mail;Epost;E-post;E-brev;Newsgroup;Nyhedsgruppe;Nyhedskilde;Usenet;Feed;RSS
Keywords[de]=Mail;E-Mail;Newsgroup;Nachrichten;Feed;RSS;Post;News;Usenet;online;lesen;schreiben
Keywords[el]=Email;E-mail;Newsgroup;Feed;RSS;ημαιλ;Αλληλογραφία;Ροή;ΡΣΣ;Συζητήσεις;Γράμματα
Keywords[es_ES]=Email;Correo electrónico;Noticias;Discusiones;Mensajes;Canales;RSS
Keywords[es_AR]=Email;Correo electrónico;Noticias;Discusiones;Mensajes;Canales;RSS
Keywords[fi]=Mail;E-Mail;Email;Newsgroup;Feed;RSS;posti;sähköposti;maili;meili;Usenet;uutisryhmät;syöte
Keywords[fr]=Mails;Mels;E-Mails;Emails;Courriels;Courriers;Newsgroup;Feed;RSS;Poster;Betterbird;Lire;Écrire
Keywords[he]=דוא"ל;דוא״ל;מייל;אי-מייל;אימייל;הודעות;מוזילה;תאנדרבירד;ת׳אנדרבירד;ת'אנדרבירד;ת׳אנדרברד;ת'אנדרברד;דואל;
Keywords[hr]=email;e-mail;e-pošta;pošta;RSS
Keywords[hu]=Email;E-mail;Levél;Levelezés;Hírcsoport;Feed;Hírforrás;RSS
Keywords[it]=Email;Mail;Posta;Newsgroup;Feed;RSS
Keywords[ja]=Eメール;イーメール;mail;e-mail;email;メール;電子メール;ニュースグループ;ネットニュース;RSS;フィードリーダー;書く;読む
Keywords[nl]=Email;E-mail;Newsgroup;Feed;RSS;Nieuwsgroep;Post
Keywords[ru]=Email;E-mail;Newsgroup;Feed;RSS;почта;письма;новости;фиды
Keywords[sk]=Email;E-mail;Elektronická pošta;Diskusné skupiny;Čítačka kanálov;RSS
Keywords[uk]=Email;E-mail;Newsgroup;Feed;RSS;пошта;новини;подачі;стрічка
Keywords[vi]=Mail;E-Mail;Email;Newsgroup;Feed;RSS;Thư điện tử;Gửi thư
Keywords[zh_CN]=Mail;E-Mail;Email;Newsgroup;Feed;RSS;电子;邮件;新闻;Betterbird;雷鸟;电邮;邮箱;阅读器;
[Desktop Action ComposeMessage]
Name=Write new message
Name[ast]=Redactar mensaxe nuevu
Name[ca]=Escriu un missatge nou
Name[cs]=Napsat novou zprávu
Name[da]=Skriv en ny meddelelse
Name[de]=Neue Nachricht verfassen
Name[el]=Σύνταξη νέου μηνύματος
Name[es_AR]=Escribir un nuevo mensaje
Name[es_ES]=Redactar nuevo mensaje
Name[fi]=Kirjoita uusi viesti
Name[fr]=Rédiger un nouveau message
Name[gl]=Escribir unha nova mensaxe
Name[he]=כתיבת הודעה חדשה
Name[hr]=Piši novu poruku
Name[hu]=Új üzenet írása
Name[it]=Scrivi nuovo messaggio
Name[ja]=新しいメッセージを作成する
Name[ko]=새 메시지 작성
Name[nl]=Nieuw bericht aanmaken
Name[pl]=Nowa wiadomość
Name[pt_BR]=Nova mensagem
Name[ru]=Создать новое сообщение
Name[sk]=Nová e-mailová správa
Name[sv]=Skriv ett nytt meddelande
Name[th]=แต่งอีเมล์ใหม่
Name[uk]=Написати нового листа
Name[vi]=Viết thư mới
Name[zh_CN]=编写新消息
Name[zh_TW]=寫一封新訊息
Exec=$installpath/betterbird/betterbird -compose
[Desktop Action OpenAddressBook]
Name=Open address book
Name[ast]=Abrir llibreta de direiciones
Name[ca]=Obre la llibreta d'adreces
Name[cs]=Otevřít Adresář
Name[da]=Åbn adressebog
Name[de]=Adressbuch öffnen
Name[el]=Άνοιγμα ευρετηρίου διευθύνσεων
Name[es_AR]=Abrir libreta de direcciones
Name[es_ES]=Abrir libreta de direcciones
Name[fi]=Avaa osoitekirja
Name[fr]=Ouvrir un carnet d'adresses
Name[gl]=Abrir a axenda de enderezos
Name[he]=פתיחת ספר כתובות
Name[hr]=Otvori adresar
Name[hu]=Címjegyzék megnyitása
Name[it]=Apri rubrica
Name[ja]=アドレス帳を開く
Name[ko]=주소록 열기
Name[nl]=Adresboek openen
Name[pl]=Książka adresowa
Name[pt_BR]=Catálogo de endereços
Name[ru]=Открыть адресную книгу
Name[sk]=Otvoriť adresár
Name[sv]=Öppna adressboken
Name[th]=เปิดสมุดที่อยู่
Name[uk]=Відкрити адресну книгу
Name[vi]=Mở sổ địa chỉ
Name[zh_CN]=打开通讯录
Name[zh_TW]=開啟通訊錄
Exec=$installpath/betterbird/betterbird -addressbook
EOF
sudo mkdir -p ${desktopfile%/*}
sudo cp $tmpdir/desktop "$desktopfile"
xdg-desktop-menu forceupdate
# Finished
echo "Betterbird-$v successfully installed. Now running:"
echo "$installpath/betterbird/betterbird --ProfileManager"
#echo "(Default seems to be good, default-default bad...)"
$installpath/betterbird/betterbird --ProfileManager &