Fix send_message function and restorecon path
This commit is contained in:
parent
936ed85639
commit
2a0edc8b70
@ -15,10 +15,10 @@ set -o nounset
|
|||||||
# Don't hide errors within pipes
|
# Don't hide errors within pipes
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
# Set your API key here
|
# set your API key here
|
||||||
key=
|
key=
|
||||||
|
|
||||||
# Set your chat id here
|
# set your chat id here
|
||||||
chat_id=
|
chat_id=
|
||||||
|
|
||||||
# Set your username
|
# Set your username
|
||||||
@ -27,11 +27,10 @@ username=
|
|||||||
function send_message() {
|
function send_message() {
|
||||||
if ! [ $# -eq 0 ]; then
|
if ! [ $# -eq 0 ]; then
|
||||||
curl --silent --show-error --fail --request POST "https://api.telegram.org/$key/sendMessage" --data chat_id="$chat_id" --data text="$1" --output /dev/null
|
curl --silent --show-error --fail --request POST "https://api.telegram.org/$key/sendMessage" --data chat_id="$chat_id" --data text="$1" --output /dev/null
|
||||||
exit
|
else
|
||||||
fi
|
|
||||||
|
|
||||||
echo "No argument supplied, please specify the message to send"
|
echo "No argument supplied, please specify the message to send"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_vaultwarden {
|
function update_vaultwarden {
|
||||||
@ -50,7 +49,7 @@ function update_vaultwarden {
|
|||||||
# Set the correct permissions
|
# Set the correct permissions
|
||||||
chown root:vaultwarden /usr/local/bin/vaultwarden
|
chown root:vaultwarden /usr/local/bin/vaultwarden
|
||||||
chmod 750 /usr/local/bin/vaultwarden
|
chmod 750 /usr/local/bin/vaultwarden
|
||||||
restorecon /usr/local/bin/vaultwarden
|
/sbin/restorecon -v /usr/local/bin/vaultwarden
|
||||||
|
|
||||||
if ! systemctl start vaultwarden.service; then
|
if ! systemctl start vaultwarden.service; then
|
||||||
send_message "[Vaultwarden] - Vaultwarden service did not start correctly. Please log in as soon as possible and see what went wrong"
|
send_message "[Vaultwarden] - Vaultwarden service did not start correctly. Please log in as soon as possible and see what went wrong"
|
||||||
|
Loading…
Reference in New Issue
Block a user