用户 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

相关内容