mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Fixed shellcheck warning SC2164: "Use 'cd ... || exit' or 'cd ... || return' in case cd fails."
This commit is contained in:
parent
8d2a800851
commit
fe636e3f43
7 changed files with 7 additions and 7 deletions
|
@ -44,7 +44,7 @@ do
|
|||
shift
|
||||
done
|
||||
|
||||
cd /etc/wireguard
|
||||
cd /etc/wireguard || exit
|
||||
if [ ! -s configs/clients.txt ]; then
|
||||
echo "::: There are no clients to change"
|
||||
exit 1
|
||||
|
|
|
@ -44,7 +44,7 @@ do
|
|||
shift
|
||||
done
|
||||
|
||||
cd /etc/wireguard
|
||||
cd /etc/wireguard || exit
|
||||
if [ ! -s configs/clients.txt ]; then
|
||||
echo "::: There are no clients to change"
|
||||
exit 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd /etc/wireguard/configs
|
||||
cd /etc/wireguard/configs || exit
|
||||
if [ ! -s clients.txt ]; then
|
||||
echo "::: There are no clients to list"
|
||||
exit 1
|
||||
|
|
|
@ -53,7 +53,7 @@ if [ ! -d "${install_home}/configs" ]; then
|
|||
chmod 0750 "${install_home}/configs"
|
||||
fi
|
||||
|
||||
cd /etc/wireguard
|
||||
cd /etc/wireguard || exit
|
||||
|
||||
if [ -z "${CLIENT_NAME}" ]; then
|
||||
read -r -p "Enter a Name for the Client: " CLIENT_NAME
|
||||
|
|
|
@ -19,7 +19,7 @@ echo -e "::::\t \e[4mInstallation settings\e[0m \t ::::"
|
|||
sed "s/$pivpnHOST/REDACTED/" < ${setupVars}
|
||||
printf "=============================================\n"
|
||||
echo -e ":::: \e[4mServer configuration shown below\e[0m ::::"
|
||||
cd /etc/wireguard/keys
|
||||
cd /etc/wireguard/keys || exit
|
||||
cp ../wg0.conf ../wg0.tmp
|
||||
# Replace every key in the server configuration with just its file name
|
||||
for k in *; do
|
||||
|
|
|
@ -27,7 +27,7 @@ do
|
|||
shift
|
||||
done
|
||||
|
||||
cd /etc/wireguard/configs
|
||||
cd /etc/wireguard/configs || exit
|
||||
if [ ! -s clients.txt ]; then
|
||||
echo "::: There are no clients to show"
|
||||
exit 1
|
||||
|
|
|
@ -40,7 +40,7 @@ do
|
|||
shift
|
||||
done
|
||||
|
||||
cd /etc/wireguard
|
||||
cd /etc/wireguard || exit
|
||||
if [ ! -s configs/clients.txt ]; then
|
||||
echo "::: There are no clients to remove"
|
||||
exit 1
|
||||
|
|
Loading…
Reference in a new issue