Skip to content

Commit 12ad885

Browse files
committed
Restart Telegram after setting token.
Signed-off-by: Bofu Chen (bafu) <bofu@dt42.io>
1 parent e56468a commit 12ad885

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

includes/telegram.php

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function DisplayTelegramConfig($username, $password)
1515
$content = '{"token": "'.$_POST['telegramtoken'].'"}';
1616
fwrite($auth_file, $content);
1717
fclose($auth_file);
18+
exec('sudo /etc/raspap/aikea/restarttelegram.sh');
1819
$status->addMessage('Telegram token updated');
1920
} else {
2021
$status->addMessage('Failed to update Telegram token', 'danger');

installers/common.sh

+4
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,14 @@ function create_aikea_scripts() {
128128
# Move service control shell scripts
129129
sudo cp "$webroot_dir/installers/"restartpipeline.sh "$raspap_dir/aikea" || install_error "Unable to move service control scripts"
130130
sudo cp "$webroot_dir/installers/"switchconfig.sh "$raspap_dir/aikea" || install_error "Unable to move service control scripts"
131+
sudo cp "$webroot_dir/installers/"restarttelegram.sh "$raspap_dir/aikea" || install_error "Unable to move service control scripts"
131132
# Make configport.sh writable by www-data group
132133
sudo chown -c root:"$raspap_user" "$raspap_dir/aikea/"restartpipeline.sh || install_error "Unable change owner and/or group"
133134
sudo chown -c root:"$raspap_user" "$raspap_dir/aikea/"switchconfig.sh || install_error "Unable change owner and/or group"
135+
sudo chown -c root:"$raspap_user" "$raspap_dir/aikea/"restarttelegram.sh || install_error "Unable change owner and/or group"
134136
sudo chmod 750 "$raspap_dir/aikea/"restartpipeline.sh || install_error "Unable to change file permissions"
135137
sudo chmod 750 "$raspap_dir/aikea/"switchconfig.sh || install_error "Unable to change file permissions"
138+
sudo chmod 750 "$raspap_dir/aikea/"restarttelegram.sh || install_error "Unable to change file permissions"
136139
}
137140

138141
# Prompt to install openvpn
@@ -341,6 +344,7 @@ function patch_system_files() {
341344
"/etc/raspap/openvpn/configauth.sh"
342345
"/etc/raspap/aikea/restartpipeline.sh"
343346
"/etc/raspap/aikea/switchconfig.sh"
347+
"/etc/raspap/aikea/restarttelegram.sh"
344348
)
345349

346350
# Check if sudoers needs patching

installers/restarttelegram.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
supervisorctl restart telegram

0 commit comments

Comments
 (0)