Better name lookup
This commit is contained in:
parent
502028bc53
commit
e455f557a1
|
@ -2417,8 +2417,6 @@ function get_mariadb_owncloud_admin_password {
|
||||||
|
|
||||||
function backup_directory_to_usb {
|
function backup_directory_to_usb {
|
||||||
echo 'function backup_directory_to_usb {' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo 'function backup_directory_to_usb {' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo " MY_NAME=\"$MY_NAME\"" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
|
||||||
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
|
||||||
echo ' if [ ! -d ${1} ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo ' if [ ! -d ${1} ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo ' echo "WARNING: directory does not exist: ${1}"' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo ' echo "WARNING: directory does not exist: ${1}"' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo ' else' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo ' else' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
|
@ -2508,6 +2506,7 @@ function create_backup_script {
|
||||||
echo 'if [ $2 ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo 'if [ $2 ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo ' MY_USERNAME=$2' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo ' MY_USERNAME=$2' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
|
echo 'MY_NAME=$(getent passwd $MY_USERNAME | cut -d: -f5 | cut -d, -f1)' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo 'if [ ! -b $USB_DRIVE ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo 'if [ ! -b $USB_DRIVE ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo ' echo "Please attach a USB drive"' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo ' echo "Please attach a USB drive"' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
|
|
Loading…
Reference in New Issue