nc_password_client/wrapper.sh

15 lines
481 B
Bash
Raw Normal View History

2024-11-16 21:54:10 +01:00
#!/bin/bash
2024-11-16 22:06:35 +01:00
CONFIG_FILE="${HOME}/.config/nc_password_client.conf"
2024-11-16 21:54:10 +01:00
cd "__src_folder__" || exit 1
2024-11-16 22:06:35 +01:00
if [ -r "${CONFIG_FILE}" ]; then
perms=$(stat -c %A "${CONFIG_FILE}")
if [ "${perms:4:6}" != '------' ]; then
echo "Permissions too open for config file '${CONFIG_FILE}' ($perms). Remove all permissions to group and others."
exit 1
fi
config=(--config "${CONFIG_FILE}")
else
config=()
fi
"__src_folder__/nc_password_client.sh" "${config[@]}" "${@}"