Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh -e
- # For every user in /home/ ...
- for HOME_U in /home/*?; do
- # Obtain the username
- USER=$( basename ${HOME_U} )
- # In case the user is active (exists in /etc/shadow) ...
- if [ $( grep -c "${USER}:.*:.*:.*:.*:.*:::" /etc/shadow ) == 1 ] \
- && [ $( grep -c "${USER}:.*:.*:.*:.*:.*:/bin/.*sh" /etc/passwd ) == 1 ] \
- && [ -d ${HOME_U}/.config ] \
- && [ -d ${HOME_U} ]; then
- # Making sure .config/your-package/ exists
- mkdir -p /home/${USER}/.config/synapse/
- mkdir -p /home/${USER}/.config/autostart/
- mkdir -p /home/${USER}/.config/Cardapio/
- mkdir -p /home/${USER}/.config/hotkeys/
- mkdir -p /home/${USER}/.gconf/apps/compiz-1/plugins/decor/screen0/options/
- # with appropiate permissions
- chown -R ${USER}:${USER} /home/${USER}/.config/synapse/
- chown -R ${USER}:${USER} /home/${USER}/.config/autostart/
- chown -R ${USER}:${USER} /home/${USER}/.config/Cardapio/
- chown -R ${USER}:${USER} /home/${USER}/.config/hotkeys/
- chown -R ${USER}:${USER} /home/${USER}/.gconf/apps/compiz-1/plugins/decor/screen0/options/
- # copy what we need
- cp /etc/skel/.config/synapse/config.json /home/${USER}/.config/synapse/config.json
- cp /etc/skel/.config/autostart/docky.desktop /home/${USER}/.config/autostart/docky.desktop
- cp /etc/skel/.config/autostart/synapse.desktop /home/${USER}/.config/autostart/synapse.desktop
- cp /etc/skel/.config/autostart/indicator-sysmonitor.desktop /home/${USER}/.config/autostart/indicator-sysmonitor.desktop
- cp /etc/skel/.config/Cardapio/config.json /home/${USER}/.config/Cardapio/config.json
- cp /etc/skel/.config/hotkeys/synapse.hotkeys /home/${USER}/.config/hotkeys/synapse.hotkeys
- cp /etc/skel/.gconf/apps/compiz-1/plugins/decor/screen0/options/%gconf.xml /home/${USER}/.gconf/apps/compiz-1/plugins/decor/screen0/options/%gconf.xml
- # with appropiate permissions
- chown ${USER}:${USER} /home/${USER}/.config/synapse/config.json
- chown ${USER}:${USER} /home/${USER}/.config/autostart/docky.desktop
- chown ${USER}:${USER} /home/${USER}/.config/autostart/synapse.desktop
- chown ${USER}:${USER} /home/${USER}/.config/autostart/indicator-sysmonitor.desktop
- chown ${USER}:${USER} /home/${USER}/.config/Cardapio/config.json
- chown ${USER}:${USER} /home/${USER}/.config/hotkeys/synapse.hotkeys
- chown ${USER}:${USER} /home/${USER}/.gconf/apps/compiz-1/plugins/decor/screen0/options/%gconf.xml
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement