用户 gsettings ubuntu 18.4

用户 gsettings ubuntu 18.4

我有一个疑问。我目前有一个脚本...当我完成 Ubuntu 18 的安装后,我会运行它。

而且我不知道如何在执行它时添加 gsettings ...这里是它启动的一个示例。

#!/bin/sh
#
######### is username and password entered? ########
if [ $# -ne 2 ]
then
echo "Username and password required."
echo "Example:"
echo "sh script-sessions users password"
exit
fi
USER = $ 1
PASSWORD = $ 2
######### is running as root? #########
me=$(whoami)
if [ "root" = $ yo ]
then
         threw out ""
else
         echo "This command must be run as administrator, run sudo su"
         exit
fi
######### Does the user exist in the system? ########

exists=$ (cat /etc/passwd | grep "$ USER:")
if [ -n "$ exists" ]; then
echo "User exists"
else
echo "The user does not exist, enter a system user."
exit
fi

相关内容