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